Copyright | Copyright (c) 2010 Patrick Perry <patperry@gmail.com> |
---|---|
License | BSD3 |
Maintainer | Patrick Perry <patperry@gmail.com> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell98 |
Summary statistics for Double
s.
- data Summary
- size :: Summary -> Int
- sum :: Summary -> Double
- sumSquaredErrors :: Summary -> Double
- mean :: Summary -> Double
- meanSE :: Summary -> Double
- meanCI :: Double -> Summary -> (Double, Double)
- stddev :: Summary -> Double
- variance :: Summary -> Double
- maximum :: Summary -> Double
- minimum :: Summary -> Double
- empty :: Summary
- singleton :: Double -> Summary
- insert :: Double -> Summary -> Summary
- insertWith :: (a -> Double) -> a -> Summary -> Summary
- union :: Summary -> Summary -> Summary
- unions :: [Summary] -> Summary
- fromList :: [Double] -> Summary
- fromListWith :: (a -> Double) -> [a] -> Summary
- toStats :: Summary -> (Int, Double, Double, Double, Double)
- fromStats :: Int -> Double -> Double -> Double -> Double -> Summary
Summary type
A type for storing summary statistics for a data set including sample size, min and max values, and first and second moments.
Properties
Sum
sumSquaredErrors :: Summary -> Double Source #
Sum of squared errors (x[i] - mean)^2
.
Mean
meanCI :: Double -> Summary -> (Double, Double) Source #
Get a Central Limit Theorem based confidence interval for the
population mean with the specified coverage level. The level must
be in the range (0,1)
.
Scale
Extremes
Construction
Insertion
insert :: Double -> Summary -> Summary Source #
Update the summary with a data point. Running mean and variance computed as in Knuth, Vol 2, page 232, 3rd edition, see http://www.johndcook.com/standard_deviation.html for a description.
insertWith :: (a -> Double) -> a -> Summary -> Summary Source #
Apply a function and update the summary with the result.
Combination
union :: Summary -> Summary -> Summary Source #
Take the union of two summaries. Use the updating rules from Chan et al. "Updating Formulae and a Pairwise Algorithm for Computing Sample Variances," available at http://infolab.stanford.edu/pub/cstr/reports/cs/tr/79/773/CS-TR-79-773.pdf.
Conversion
Lists
fromListWith :: (a -> Double) -> [a] -> Summary Source #
Map a function over a list of values and summarize the results.