monte-carlo-0.6.1: A monad and transformer for Monte Carlo calculations.

Stabilityexperimental
MaintainerPatrick Perry <patperry@gmail.com>
Safe HaskellNone

Data.Summary.Double

Contents

Description

Summary statistics for Doubles.

Synopsis

Summary type

data Summary Source

A type for storing summary statistics for a data set including sample size, min and max values, and first and second moments.

Properties

Sum

size :: Summary -> IntSource

Number of observations.

sum :: Summary -> DoubleSource

Sum of values.

sumSquaredErrors :: Summary -> DoubleSource

Sum of squared errors (x[i] - mean)^2.

Mean

mean :: Summary -> DoubleSource

Mean value.

meanSE :: Summary -> DoubleSource

Standard error of the 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

stddev :: Summary -> DoubleSource

Sample standard deviation.

variance :: Summary -> DoubleSource

Sample variance.

Extremes

maximum :: Summary -> DoubleSource

Maximum value.

minimum :: Summary -> DoubleSource

Minimum value.

Construction

empty :: SummarySource

An empty summary.

singleton :: Double -> SummarySource

Summarize a single value.

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.

unions :: [Summary] -> SummarySource

Take the union of a list of summaries.

Conversion

Lists

fromList :: [Double] -> SummarySource

Get a summary of a list of values.

fromListWith :: (a -> Double) -> [a] -> SummarySource

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

Statistics

toStats :: Summary -> (Int, Double, Double, Double, Double)Source

Convert to (size, mean, sumSquaredErrors, minimum, maximum).

fromStats :: Int -> Double -> Double -> Double -> Double -> SummarySource

Convert from (size, mean, sumSquaredErrors, minimum, maximum). No validation is performed.