Safe Haskell | None |
---|---|
Language | Haskell2010 |
TDigest
postprocessing functions.
These are re-exported from Data.TDigest module.
- histogram :: TDigest comp -> Maybe (NonEmpty HistBin)
- data HistBin = HistBin {}
- median :: TDigest comp -> Maybe Double
- quantile :: Double -> TDigest comp -> Maybe Double
- mean :: TDigest comp -> Maybe Double
- mean' :: NonEmpty HistBin -> Double
- variance :: TDigest comp -> Maybe Double
- variance' :: NonEmpty HistBin -> Double
- cdf :: Double -> TDigest comp -> Double
- icdf :: Double -> TDigest comp -> Maybe Double
- histogram' :: NonEmpty (Mean, Weight) -> NonEmpty HistBin
- quantile' :: Double -> Weight -> NonEmpty HistBin -> Double
- validateHistogram :: Foldable f => f HistBin -> Either String (f HistBin)
Histogram
histogram :: TDigest comp -> Maybe (NonEmpty HistBin) Source #
Calculate histogram based on the TDigest
.
Histogram bin
Quantiles
Mean & variance
As we have "full" histogram, we can calculate other statistical variables.
mean :: TDigest comp -> Maybe Double Source #
Mean.
>>>
mean (tdigest [1..100] :: TDigest 10)
Just 50.5
Note: if you only need the mean, calculate it directly.
CDF
cdf :: Double -> TDigest comp -> Double Source #
Cumulative distribution function.
Note: if this is the only thing you need, it's more efficient to count this directly.