Stability | experimental |
---|---|

Maintainer | Patrick Perry <patperry@gmail.com> |

Safe Haskell | None |

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 -> DoubleSource

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 -> SummarySource

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 -> SummarySource

Apply a function and update the summary with the result.

# Combination

union :: Summary -> Summary -> SummarySource

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] -> SummarySource

Map a function over a list of values and summarize the results.