This module computes the histogram by the specified data and strategy applied for such computing.
The code in this module is essentially based on the http://hackage.haskell.org/package/Histogram package by Mike Izbicki, who kindly agreed to re-license his library under BSD3, which allowed me to use his code and comments with some modifications.
- type Histogram = [(Double, [Int])]
- histogram :: BinningStrategy -> [[Double]] -> Histogram
- histogramBinSize :: Double -> [[Double]] -> Histogram
- histogramNumBins :: Int -> [[Double]] -> Histogram
- type BinningStrategy = [Double] -> Int
- binSturges :: BinningStrategy
- binDoane :: BinningStrategy
- binSqrt :: BinningStrategy
- binScott :: BinningStrategy
Holds all the information needed to plot the histogram
for a list of different series. Each series produces its
own item in the resuling
[Int] list that may contain
Creates a histogram by specifying the list of series. Call it with one of
the binning strategies that is appropriate to the type of data you have.
If you don't know, then try using
Create a histogram by specifying the exact bin size. You probably don't want to use this function, and should use histogram with an appropriate binning strategy.
Create a histogram by the specified approximated number of bins. You probably don't want to use this function, and should use histogram with an appropriate binning strategy.
Sturges' binning strategy is the least computational work, but recommended for only normal data.
Doane's binning strategy extends Sturges' for non-normal data. It takes a little more time because it must calculate the kurtosis (peakkiness) of the distribution.
Using the sqrt of the number of samples is not supported by any theory, but is commonly used by excel and other histogram making software.