tdigest-0.2.1: On-line accumulation of rank-based statistics

Safe HaskellSafe
LanguageHaskell2010

Data.TDigest.Postprocess.Internal

Contents

Description

TDigest postprocessing functions.

These are re-exported from Data.TDigest module.

Synopsis

Histogram

class Affine f => HasHistogram a f | a -> f where Source #

Types from which we can extract histogram.

Minimal complete definition

histogram, totalWeight

data HistBin Source #

Histogram bin

Constructors

HistBin 

Fields

Quantiles

quantile :: Double -> Weight -> NonEmpty HistBin -> Double Source #

Quantile from the histogram.

Mean & variance

As we have "full" histogram, we can calculate other statistical variables.

mean :: NonEmpty HistBin -> Double Source #

Mean from the histogram.

variance :: NonEmpty HistBin -> Double Source #

Variance from the histogram.

CDF

cdf Source #

Arguments

:: Double 
-> Double

total weight

-> [HistBin] 
-> Double 

Cumulative distribution function.

Debug

validateHistogram :: Foldable f => f HistBin -> Either String (f HistBin) Source #

Validate that list of HistBin is a valid "histogram".

Affine - internal

class Traversable t => Affine t where Source #

Affine containers, i.e. containing at most 1 element

This class doesn't have traverse analogie as it would require using Pointed which is disputed type class.

traverseAff :: Pointed f => (a -> f b) -> t a -> f (t b)

Minimal complete definition

fromAffine | affine

Methods

affine :: b -> (a -> b) -> t a -> b Source #

Like foldMap

fromAffine :: a -> t a -> a Source #

Instances
Affine Maybe Source # 
Instance details

Defined in Data.TDigest.Postprocess.Internal

Methods

affine :: b -> (a -> b) -> Maybe a -> b Source #

fromAffine :: a -> Maybe a -> a Source #

Affine Identity Source # 
Instance details

Defined in Data.TDigest.Postprocess.Internal

Methods

affine :: b -> (a -> b) -> Identity a -> b Source #

fromAffine :: a -> Identity a -> a Source #

Affine (Proxy :: * -> *) Source # 
Instance details

Defined in Data.TDigest.Postprocess.Internal

Methods

affine :: b -> (a -> b) -> Proxy a -> b Source #

fromAffine :: a -> Proxy a -> a Source #

(Affine f, Affine g) => Affine (Compose f g) Source #

Composition of Affine containers is Affine

Instance details

Defined in Data.TDigest.Postprocess.Internal

Methods

affine :: b -> (a -> b) -> Compose f g a -> b Source #

fromAffine :: a -> Compose f g a -> a Source #