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

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

Data.Summary.Bool

Contents

Description

Summary statistics for Bools.

Synopsis

Summary type

data Summary Source

A type for storing summary statistics for a data set of booleans. Specifically, this just keeps track of the number of True events and gives estimates for the success probability. True is interpreted as a one, and False is interpreted as a zero.

Properties

Sum

size :: Summary -> IntSource

Number of observations.

sum :: Summary -> IntSource

Number of True values.

Mean

mean :: Summary -> DoubleSource

Proportion of True values.

meanSE :: Summary -> DoubleSource

Standard error for the mean (proportion of True values).

meanCI :: Double -> Summary -> (Double, Double)Source

Central Limit Theorem based confidence interval for the population mean (proportion) at the specified coverage level. The level must be in the range (0,1).

Construction

empty :: SummarySource

Get an empty summary.

singleton :: Bool -> SummarySource

Summarize a single value.

Insertion

insert :: Bool -> Summary -> SummarySource

Update the summary with a data point.

insertWith :: (a -> Bool) -> a -> Summary -> SummarySource

Apply a function and update the summary with the result.

Combination

union :: Summary -> Summary -> SummarySource

Take the union of two summaries.

unions :: [Summary] -> SummarySource

Take the union of a list of summaries.

Conversion

Lists

fromList :: [Bool] -> SummarySource

Get a summary of a list of values.

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

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

Statistics

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

Convert to (size,sum).

fromStats :: Int -> Int -> SummarySource

Convert from (size,sum). No validation is performed.