Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data Averager a b
- online :: Fractional b => (a -> b) -> (b -> b) -> Fold a b
- av :: Fractional a => Fold a a
- ma :: Fractional a => a -> Fold a a
- absma :: Fractional a => a -> Fold a a
- sqma :: Fractional a => a -> Fold a a
- std :: Floating a => a -> Fold a a
- cov :: Floating a => Fold a a -> Fold (a, a) a
- corr :: Floating a => Fold a a -> Fold a a -> Fold (a, a) a
- corrGauss :: Floating a => a -> Fold (a, a) a
- beta :: Floating a => Fold a a -> Fold (a, a) a
- alpha :: Floating a => Fold a a -> Fold (a, a) a
- autocorr :: (Floating a, RealFloat a) => Fold a a -> Fold (a, a) a -> Fold a a
convert a statistic to online
Most common statistics are averages.
online :: Fractional b => (a -> b) -> (b -> b) -> Fold a b Source #
online takes a function and turns it into a Fold
where the step is an incremental update of the (isomorphic) statistic.
common statistics
av :: Fractional a => Fold a a Source #
average
online statistics
ma :: Fractional a => a -> Fold a a Source #
moving average
absma :: Fractional a => a -> Fold a a Source #
absolute average
sqma :: Fractional a => a -> Fold a a Source #
average square
cov :: Floating a => Fold a a -> Fold (a, a) a Source #
the covariance of a tuple given an underlying central tendency fold
corr :: Floating a => Fold a a -> Fold a a -> Fold (a, a) a Source #
a generalised version of correlation of a tuple
corrGauss :: Floating a => a -> Fold (a, a) a Source #
correlation of a tuple, specialised to Guassian
beta :: Floating a => Fold a a -> Fold (a, a) a Source #
the beta in a simple linear regression of a tuple given an underlying central tendency fold
autocorr :: (Floating a, RealFloat a) => Fold a a -> Fold (a, a) a -> Fold a a Source #
autocorrelation is a slippery concept. This method starts with the concept that there is an underlying random error process (e), and autocorrelation is a process on top of that ie for a one-step correlation relationship.
valuet = e
t + k * e@t-1
where k is the autocorrelation.
There are thus two online rates needed: one for the average being considered to be the dependent variable, and one for the online of the correlation calculation between the most recent value and the moving average. For example,
>>>
L.fold (autocorr 0 1)
would estimate the one-step autocorrelation relationship of the previous value and the current value over the entire sample set.