Copyright | (c) OleksandrZhabenko 2020 |
---|---|
License | MIT |
Maintainer | olexandr543@yahoo.com |
Stability | Experimental |
Safe Haskell | None |
Language | Haskell2010 |
A very basic descriptive statistics. Functions use a tail recursion approach to compute the values and are strict by an accumulator.
Synopsis
- mean2F :: [Float] -> Float# -> Int# -> Float
- mean2D :: [Double] -> Double# -> Int# -> Double
- meanWithDispersion :: (RealFrac a, Floating a) => [a] -> a -> a -> a -> a -> a -> (a, a)
- meanWithDispersionF :: [Float] -> Float# -> Float# -> Int# -> (Float, Float)
- meanWithDispersionD :: [Double] -> Double# -> Double# -> Int# -> (Double, Double)
- meanF :: [Float] -> Float
- meanD :: [Double] -> Double
- meanWithDisp :: (RealFrac a, Floating a) => [a] -> (a, a)
- meanWithDispF2 :: [Float] -> (Float, Float)
- meanWithDispD2 :: [Double] -> (Double, Double)
Documentation
mean2F :: [Float] -> Float# -> Int# -> Float Source #
Uses GHC unlifted types from ghc-prim
package.
Similar code is here: Don Stewart. https://donsbot.wordpress.com/2008/05/06/write-haskell-as-fast-as-c-exploiting-strictness-laziness-and-recursion/
And here: http://fixpt.de/blog/2017-12-04-strictness-analysis-part-1.html
And here: Michael Snoyman. https://www.fpcomplete.com/blog/2017/09/all-about-strictness/
mean2D :: [Double] -> Double# -> Int# -> Double Source #
Uses GHC unlifted types from ghc-prim
package.
Similar code is here: Don Stewart. https://donsbot.wordpress.com/2008/05/06/write-haskell-as-fast-as-c-exploiting-strictness-laziness-and-recursion/
And here: http://fixpt.de/blog/2017-12-04-strictness-analysis-part-1.html
And here: Michael Snoyman. https://www.fpcomplete.com/blog/2017/09/all-about-strictness/
meanWithDispersion :: (RealFrac a, Floating a) => [a] -> a -> a -> a -> a -> a -> (a, a) Source #
One-pass and tail-recursive realization for the pair of the mean and dispersion. Is vulnerable to the floating-point cancellation errors. Similar code is here: Don Stewart. https://donsbot.wordpress.com/2008/05/06/write-haskell-as-fast-as-c-exploiting-strictness-laziness-and-recursion/ And here: http://fixpt.de/blog/2017-12-04-strictness-analysis-part-1.html And here: Michael Snoyman. https://www.fpcomplete.com/blog/2017/09/all-about-strictness/ When using the needed, please, refer better to their variants.
Among the meanWithDispersion
, meanWithDisprsionF
and meanWithDispersionD
better to use the last one.
meanWithDispersionF :: [Float] -> Float# -> Float# -> Int# -> (Float, Float) Source #
Among the meanWithDispersion
, meanWithDisprsionF
and meanWithDispersionD
better to use the last one.
meanWithDispersionD :: [Double] -> Double# -> Double# -> Int# -> (Double, Double) Source #
Among the meanWithDispersion
, meanWithDisprsionF
and meanWithDispersionD
better to use the last one.
meanWithDisp :: (RealFrac a, Floating a) => [a] -> (a, a) Source #
Among the meanWithDisp
, meanWithDispF2
and meanWithDispD2
better to use the last one.
meanWithDispF2 :: [Float] -> (Float, Float) Source #
Among the meanWithDisp
, meanWithDispF2
and meanWithDispD2
better to use the last one.
meanWithDispD2 :: [Double] -> (Double, Double) Source #
Among the meanWithDisp
, meanWithDispF2
and meanWithDispD2
better to use the last one.