tdigest-0.2.1.1: On-line accumulation of rank-based statistics
Safe HaskellNone
LanguageHaskell2010

Data.TDigest.Tree.NonEmpty

Description

This is non empty version of TDigest, i.e. this is not a Monoid, but on the other hand, quantile returns Double not Maybe Double.

See Data.TDigest for documentation. The exports should be similar, sans non-Maybe results.

Examples

>>> quantile 0.99 (tdigest (1 :| [2..1000]) :: TDigest 25)
990.5
>>> quantile 0.99 (tdigest (1 :| [2..1000]) :: TDigest 3)
989.0...

t-Digest is more precise in tails, especially median is imprecise:

>>> median (forceCompress $ tdigest (1 :| [2..1000]) :: TDigest 25)
497.6...
Synopsis

Construction

data TDigest comp Source #

Instances

Instances details
KnownNat comp => Reducer Double (TDigest comp) Source # 
Instance details

Defined in Data.TDigest.Tree.NonEmpty

Methods

unit :: Double -> TDigest comp #

snoc :: TDigest comp -> Double -> TDigest comp #

cons :: Double -> TDigest comp -> TDigest comp #

Show (TDigest comp) Source # 
Instance details

Defined in Data.TDigest.Tree.NonEmpty

Methods

showsPrec :: Int -> TDigest comp -> ShowS #

show :: TDigest comp -> String #

showList :: [TDigest comp] -> ShowS #

KnownNat comp => Semigroup (TDigest comp) Source # 
Instance details

Defined in Data.TDigest.Tree.NonEmpty

Methods

(<>) :: TDigest comp -> TDigest comp -> TDigest comp #

sconcat :: NonEmpty (TDigest comp) -> TDigest comp #

stimes :: Integral b => b -> TDigest comp -> TDigest comp #

KnownNat comp => Binary (TDigest comp) Source # 
Instance details

Defined in Data.TDigest.Tree.NonEmpty

Methods

put :: TDigest comp -> Put #

get :: Get (TDigest comp) #

putList :: [TDigest comp] -> Put #

NFData (TDigest comp) Source # 
Instance details

Defined in Data.TDigest.Tree.NonEmpty

Methods

rnf :: TDigest comp -> () #

HasHistogram (TDigest comp) Identity Source # 
Instance details

Defined in Data.TDigest.Tree.NonEmpty

tdigest :: (Foldable1 f, KnownNat comp) => f Double -> TDigest comp Source #

Population

insert :: KnownNat comp => Double -> TDigest comp -> TDigest comp Source #

insert' :: KnownNat comp => Double -> TDigest comp -> TDigest comp Source #

Compression

compress :: forall comp. KnownNat comp => TDigest comp -> TDigest comp Source #

forceCompress :: forall comp. KnownNat comp => TDigest comp -> TDigest comp Source #

Statistics

Percentile

Mean & variance

CDF

icdf :: Double -> TDigest comp -> Double Source #

Alias of quantile.

Debug

size :: TDigest comp -> Int Source #

debugPrint :: TDigest comp -> IO () Source #