Portability | non-portable (GADTs, Rank2Types) |
---|---|
Stability | experimental |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | None |
- class Eval k where
- (@@) :: (Eval k, Foldable f) => k a b -> f a -> b
- class Naive k where
- (@@@) :: (Naive k, Foldable f) => k a b -> f a -> b
- data Pass k a b where
- class Passable t where
- class Prep t => Step t where
- data Calc k a b where
- class Calculation t where
- class Prep t where
- prep :: k a b -> t k b c -> t k a c
- data L a b where
- LTotal :: (Num a, Ord a) => L a a
- LMean :: (Fractional a, Ord a) => L a a
- LScale :: (Fractional a, Ord a) => L a a
- NthLargest :: (Num a, Ord a) => Int -> L a a
- NthSmallest :: (Num a, Ord a) => Int -> L a a
- QuantileBy :: (Fractional a, Ord a) => Estimator -> Rational -> L a a
- Winsorized :: (Fractional b, Ord b) => Rational -> L a b -> L a b
- Trimmed :: (Fractional b, Ord b) => Rational -> L a b -> L a b
- Jackknifed :: (Fractional b, Ord b) => L a b -> L a b
- :* :: Fractional b => Rational -> L a b -> L a b
- :+ :: Num b => L a b -> L a b -> L a b
- (@#) :: Num a => L a a -> Int -> [a]
- breakdown :: (Num b, Eq b) => L a b -> Int
- iqm :: (Robust l, Fractional a, Ord a) => l a a
- idm :: (Robust l, Fractional a, Ord a) => l a a
- data Estimator
- class By k where
- class Robust l where
- robust :: L a b -> l a b
- winsorized :: (Fractional b, Ord b) => Rational -> L a b -> l a b
- trimmed :: (Fractional b, Ord b) => Rational -> L a b -> l a b
- jackknifed :: (Fractional b, Ord b) => L a b -> l a b
- lscale :: (Fractional a, Ord a) => l a a
- quantile :: (Fractional a, Ord a) => Rational -> l a a
- midhinge :: (Fractional a, Ord a) => l a a
- trimean :: (Fractional a, Ord a) => l a a
- iqr :: (Fractional a, Ord a) => l a a
- idr :: (Fractional a, Ord a) => l a a
- median :: (Robust l, Fractional a, Ord a) => l a a
- tercile :: (Robust l, Fractional a, Ord a) => Rational -> l a a
- t1 :: (Robust l, Fractional a, Ord a) => l a a
- t2 :: (Robust l, Fractional a, Ord a) => l a a
- quartile :: (Robust l, Fractional a, Ord a) => Rational -> l a a
- q1 :: (Robust l, Fractional a, Ord a) => l a a
- q2 :: (Robust l, Fractional a, Ord a) => l a a
- q3 :: (Robust l, Fractional a, Ord a) => l a a
- quintile :: (Robust l, Fractional a, Ord a) => Rational -> l a a
- qu1 :: (Robust l, Fractional a, Ord a) => l a a
- qu2 :: (Robust l, Fractional a, Ord a) => l a a
- qu3 :: (Robust l, Fractional a, Ord a) => l a a
- qu4 :: (Robust l, Fractional a, Ord a) => l a a
- percentile :: (Robust l, Fractional a, Ord a) => Rational -> l a a
- permille :: (Robust l, Fractional a, Ord a) => Rational -> l a a
- class Accelerated k where
- data Thrist k a b where
- thrist :: k a b -> Thrist k a b
- class Trans t where
- class Named k => Call k where
- call :: k a b -> a -> b
- class Typeable2 k => Named k where
- class Accelerant k where
Evaluation
Single pass calculations
Pass :: (Typeable m, Binary m, Monoid m) => (m -> o) -> Thrist k i m -> Pass k i o | |
L :: (n -> o) -> L n n -> Thrist k i n -> Pass k i o | |
Ap :: (b -> c) -> Pass k i (a -> b) -> Pass k i a -> Pass k i c | |
Pure :: a -> Pass k i a |
Trans Pass | |
Prep Pass | |
Passable Pass | |
Calculation Pass | |
Step Pass | |
Typeable2 k => Typeable2 (Pass k) | |
By (Pass k) | |
Call k => Naive (Pass k) | |
Call k => Eval (Pass k) | |
Robust (Pass k) | |
Accelerant k => Accelerated (Pass k) | |
Functor (Pass k a) | |
Functor (Pass k a) => Applicative (Pass k a) | |
(Fractional (Pass k a b), Floating b) => Floating (Pass k a b) | |
(Num (Pass k a b), Fractional b) => Fractional (Pass k a b) | |
Num b => Num (Pass k a b) |
Embedding single pass calculations
Multipass calculations
Stop :: b -> Calc k a b | |
:& :: Pass k a b -> (b -> Calc k a c) -> Calc k a c | |
Rank :: Ord b => Thrist k a b -> ([Int] -> Calc k a c) -> Calc k a c |
Trans Calc | |
Prep Calc | |
Calculation Calc | |
Step Calc | |
By (Calc k) | |
Call k => Naive (Calc k) | |
Call k => Eval (Calc k) | |
Robust (Calc k) | |
Accelerant k => Accelerated (Calc k) | |
Monad (Calc k a) | |
Functor (Calc k a) | |
Functor (Calc k a) => Applicative (Calc k a) | |
(Fractional (Calc k a b), Floating b) => Floating (Calc k a b) | |
(Num (Calc k a b), Fractional b) => Fractional (Calc k a b) | |
Num b => Num (Calc k a b) |
class Calculation t whereSource
Input conditioning
L-Estimators
An L-Estimator represents a linear combination of order statistics
LTotal :: (Num a, Ord a) => L a a | |
LMean :: (Fractional a, Ord a) => L a a | |
LScale :: (Fractional a, Ord a) => L a a | |
NthLargest :: (Num a, Ord a) => Int -> L a a | |
NthSmallest :: (Num a, Ord a) => Int -> L a a | |
QuantileBy :: (Fractional a, Ord a) => Estimator -> Rational -> L a a | |
Winsorized :: (Fractional b, Ord b) => Rational -> L a b -> L a b | |
Trimmed :: (Fractional b, Ord b) => Rational -> L a b -> L a b | |
Jackknifed :: (Fractional b, Ord b) => L a b -> L a b | |
:* :: Fractional b => Rational -> L a b -> L a b | |
:+ :: Num b => L a b -> L a b -> L a b |
(@#) :: Num a => L a a -> Int -> [a]Source
f @# n
Return a list of the coefficients that would be used by an L-Estimator for an input of length n
breakdown :: (Num b, Eq b) => L a b -> IntSource
A common measure of how robust an L estimator is in the presence of outliers.
iqm :: (Robust l, Fractional a, Ord a) => l a aSource
interquartile mean
idm :: (Robust l, Fractional a, Ord a) => l a aSource
Quantile estimators
Techniques used to smooth the nearest values when calculating quantile functions. R2 is used by default, and the numbering convention follows the use in the R programming language, as far as it goes.
R1 | Inverse of the empirical distribution function |
R2 | .. with averaging at discontinuities (default) |
R3 | The observation numbered closest to Np. NB: does not yield a proper median |
R4 | Linear interpolation of the empirical distribution function. NB: does not yield a proper median. |
R5 | .. with knots midway through the steps as used in hydrology. This is the simplest continuous estimator that yields a correct median |
R6 | Linear interpolation of the expectations of the order statistics for the uniform distribution on [0,1] |
R7 | Linear interpolation of the modes for the order statistics for the uniform distribution on [0,1] |
R8 | Linear interpolation of the approximate medans for order statistics. |
R9 | The resulting quantile estimates are approximately unbiased for the expected order statistics if x is normally distributed. |
R10 | When rounding h, this yields the order statistic with the least expected square deviation relative to p. |
HD | The Harrell-Davis quantile estimator based on bootstrapped order statistics |
Robust statistics based on L-estimators
embedding for L-estimators
robust :: L a b -> l a bSource
winsorized :: (Fractional b, Ord b) => Rational -> L a b -> l a bSource
trimmed :: (Fractional b, Ord b) => Rational -> L a b -> l a bSource
jackknifed :: (Fractional b, Ord b) => L a b -> l a bSource
lscale :: (Fractional a, Ord a) => l a aSource
quantile :: (Fractional a, Ord a) => Rational -> l a aSource
midhinge :: (Fractional a, Ord a) => l a aSource
trimean :: (Fractional a, Ord a) => l a aSource
Tukey's trimean
iqr :: (Fractional a, Ord a) => l a aSource
interquartile range
idr :: (Fractional a, Ord a) => l a aSource
median :: (Robust l, Fractional a, Ord a) => l a aSource
t1 :: (Robust l, Fractional a, Ord a) => l a aSource
terciles 1 and 2
t2 :: (Robust l, Fractional a, Ord a) => l a aSource
terciles 1 and 2
q1 :: (Robust l, Fractional a, Ord a) => l a aSource
quantiles, with breakdown points 25%, 50%, and 25% respectively
q2 :: (Robust l, Fractional a, Ord a) => l a aSource
quantiles, with breakdown points 25%, 50%, and 25% respectively
q3 :: (Robust l, Fractional a, Ord a) => l a aSource
quantiles, with breakdown points 25%, 50%, and 25% respectively
qu1 :: (Robust l, Fractional a, Ord a) => l a aSource
quintiles 1 through 4
qu2 :: (Robust l, Fractional a, Ord a) => l a aSource
quintiles 1 through 4
qu3 :: (Robust l, Fractional a, Ord a) => l a aSource
quintiles 1 through 4
qu4 :: (Robust l, Fractional a, Ord a) => l a aSource
quintiles 1 through 4
percentile :: (Robust l, Fractional a, Ord a) => Rational -> l a aSource
Acceleration for non-robust L-estimators
class Accelerated k whereSource
Accelerated L | |
Accelerated k => Accelerated (Thrist k) | |
Accelerated k => Accelerated (Fun k) | |
Accelerant k => Accelerated (Pass k) | |
Accelerant k => Accelerated (Calc k) |
Implementation Details
Trans Thrist | |
Prep Thrist | |
Passable Thrist | |
Calculation Thrist | |
Typeable2 k => Typeable2 (Thrist k) | |
Category (Thrist k) | |
By k => By (Thrist k) | |
(Typeable2 (Thrist k), Named k) => Named (Thrist k) | |
(Named (Thrist k), Call k) => Call (Thrist k) | |
Accelerated k => Accelerated (Thrist k) | |
Named k => Eq (Thrist k a b) | |
Named k => Show (Thrist k a b) | |
Named k => Hashable (Thrist k a b) |