statistics-0.13.2.3: A library of statistical types, data, and functions

Copyright | (c) 2009, 2010 Bryan O'Sullivan
License | BSD3
Maintainer | bos@serpentine.com
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell98

Statistics.Resampling

Description

Resampling statistics.

Synopsis

- newtype Resample = Resample {
  - fromResample :: Vector Double
  }
- jackknife :: Estimator -> Sample -> Vector Double
- jackknifeMean :: Sample -> Vector Double
- jackknifeVariance :: Sample -> Vector Double
- jackknifeVarianceUnb :: Sample -> Vector Double
- jackknifeStdDev :: Sample -> Vector Double
- resample :: GenIO -> [Estimator] -> Int -> Sample -> IO [Resample]
- estimate :: Estimator -> Sample -> Double
- splitGen :: Int -> GenIO -> IO [GenIO]

# Documentation

newtype Resample Source

A resample drawn randomly, with replacement, from a set of data points. Distinct from a normal array to make it harder for your humble author's brain to go wrong.

Constructors

Resample |

Fields

fromResample :: Vector Double

Instances

Eq Resample Source |
Data Resample Source |
Read Resample Source |
Show Resample Source |
Generic Resample Source |
ToJSON Resample Source |
FromJSON Resample Source |
Binary Resample Source |
type Rep Resample Source |

jackknife :: Estimator -> Sample -> Vector Double Source

O(n) or O(n^2) Compute a statistical estimate repeatedly over a sample, each time omitting a successive element.

jackknifeMean :: Sample -> Vector Double Source

O(n) Compute the jackknife mean of a sample.

jackknifeVariance :: Sample -> Vector Double Source

O(n) Compute the jackknife variance of a sample.

jackknifeVarianceUnb :: Sample -> Vector Double Source

O(n) Compute the unbiased jackknife variance of a sample.

jackknifeStdDev :: Sample -> Vector Double Source

O(n) Compute the jackknife standard deviation of a sample.

resample Source

Arguments

:: GenIO |
-> [Estimator] | Estimation functions.
-> Int | Number of resamples to compute.
-> Sample | Original sample.
-> IO [Resample] |

O(e*r*s) Resample a data set repeatedly, with replacement, computing each estimate over the resampled data.

This function is expensive; it has to do work proportional to e*r*s, where e is the number of estimation functions, r is the number of resamples to compute, and s is the number of original samples.

To improve performance, this function will make use of all available CPUs. At least with GHC 7.0, parallel performance seems best if the parallel garbage collector is disabled (RTS option `-qg`).

estimate :: Estimator -> Sample -> Double Source

Run an `Estimator` over a sample.

splitGen :: Int -> GenIO -> IO [GenIO] Source

Split a generator into several that can run independently.