Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data TDigest (compression :: Nat) = TDigest {
- tdigestTotalWeight :: !Size
- tdigestData :: !(Vector Centroid)
- tdigestBufferSize :: !Size
- tdigestBuffer :: [Double]
- tdigestDirection :: !Bool
- size :: TDigest comp -> Int
- totalWeight :: TDigest comp -> Weight
- minimumValue :: KnownNat comp => TDigest comp -> Mean
- maximumValue :: KnownNat comp => TDigest comp -> Mean
- ksize :: Double -> Double -> Double
- clamp :: Double -> Double
- ksizeInv :: Double -> Double -> Double
- merge :: Int -> Double -> [(Mean, Weight)] -> [(Mean, Weight)]
- emptyTDigest :: TDigest comp
- combineTDigest :: forall comp. KnownNat comp => TDigest comp -> TDigest comp -> TDigest comp
- finalize :: forall comp. KnownNat comp => TDigest comp -> TDigest comp
- forceCompress :: forall comp. KnownNat comp => TDigest comp -> TDigest comp
- compress :: forall comp. KnownNat comp => TDigest comp -> TDigest comp
- sizeCoefficient :: Num a => a
- valid :: TDigest comp -> Bool
- validate :: TDigest comp -> Either String (TDigest comp)
- insert :: KnownNat comp => Double -> TDigest comp -> TDigest comp
- insert' :: KnownNat comp => Double -> TDigest comp -> TDigest comp
- singleton :: Double -> TDigest comp
- tdigest :: (Foldable f, KnownNat comp) => f Double -> TDigest comp
Documentation
data TDigest (compression :: Nat) Source #
TDigest
is a vector of centroids plus not yet merged elements.
The size of structure is dictated by compression
, *𝛿*. And is *O(𝛿)*.
TDigest | |
|
Instances
KnownNat comp => Reducer Double (TDigest comp) Source # | |
Show (TDigest compression) Source # | |
KnownNat comp => Semigroup (TDigest comp) Source # | |
KnownNat comp => Monoid (TDigest comp) Source # | |
NFData (TDigest comp) Source # | |
Defined in Data.TDigest.Vector.Internal | |
KnownNat comp => HasHistogram (TDigest comp) Maybe Source # | |
totalWeight :: TDigest comp -> Weight Source #
minimumValue :: KnownNat comp => TDigest comp -> Mean Source #
Center of left-most centroid. Note: may be different than min element inserted.
>>>
minimumValue (tdigest [1..100] :: TDigest 3)
1.0
maximumValue :: KnownNat comp => TDigest comp -> Mean Source #
Center of right-most centroid. Note: may be different than max element inserted.
>>>
maximumValue (tdigest [1..100] :: TDigest 3)
100.0
Mapping from quantile *q* to notional index *k* with compression parameter *𝛿*.
>>>
ksize 42 0
0.0
>>>
ksize 42 1
42.0
- q@ is clamped.:
>>>
ksize 42 2
42.0
emptyTDigest :: TDigest comp Source #
combineTDigest :: forall comp. KnownNat comp => TDigest comp -> TDigest comp -> TDigest comp Source #
finalize :: forall comp. KnownNat comp => TDigest comp -> TDigest comp Source #
Flush insertion buffer
sizeCoefficient :: Num a => a Source #
validate :: TDigest comp -> Either String (TDigest comp) Source #
Check various invariants in the TDigest
structure.
Insert single value into TDigest
.
>>>
:set -XDataKinds