skfolio.utils.stats.n_bins_freedman#

skfolio.utils.stats.n_bins_freedman(x)[source]#

Compute the optimal histogram bin size using the Freedman-Diaconis rule [1].

Parameters:
xndarray of shape (n_observations,)

The input array.

Returns:
n_binsint

The optimal bin size.

References

[1]

“On the histogram as a density estimator: L2 theory”. Freedman & Diaconis (1981).