circuits-stats
Safe HaskellNone
LanguageGHC2024

Circuit.Stats.Quantiles

Description

Process quantile statistics.

Synopsis

Documentation

median :: Double -> Process Double Double Source #

Process median using the t-digest algorithm.

The t-digest algorithm works best at extremes and can be unreliable in the centre.

quantiles :: Double -> [Double] -> Process Double [Double] Source #

Process quantiles based on the t-digest library.

digitize :: Double -> [Double] -> Process Double Int Source #

A process that computes the running quantile bucket. For example, in a scan, digitize 0.9 [0.5] returns:

  • 0 if the current value is less than the current process median.
  • 1 if the current value is greater than the current process median.

signalize :: Double -> [Double] -> Process Double Double Source #

transform an input to a [0,1] signal, via digitalization.

data OnlineTDigest Source #

An online t-digest with exponential decay weighting.

Each inserted point receives weight r ** (-(n+1)) where n counts insertions since the last forced compression. Periodically the weights are rescaled so that older points decay relative to newer ones.

Constructors

OnlineTDigest 

Fields

Instances

Instances details
Show OnlineTDigest Source # 
Instance details

Defined in Circuit.Stats.Quantiles

onlineCompress :: OnlineTDigest -> OnlineTDigest Source #

Force a compression pass when the digest has grown enough that the decay weights are becoming numerically awkward. The threshold is chosen to keep weights within a comfortable double range while preserving the exponential-decay semantics.

onlineForceCompress :: OnlineTDigest -> OnlineTDigest Source #

Rescale all centroid weights by r ** n and reset the insertion counter. This is the exponential-decay equivalent of normalising weights.