statistics-fusion-1.0.1: An implementation of high performance, minimal statistics functions

Portabilityportable
Stabilityexperimental
Maintainerdons@galois.com

Math.Statistics.Fusion

Description

Description :

A collection of commonly used statistical functions designed to fuse under stream fusion, with attention paid to the generated assembly.

These are high performance replacements for various list functions, implemented in pure Haskell using stream fusion for sequences.

To illustrate the performance gap, consider the task of calculating the numerically stable mean of a sequence of 1e9 double values.

Using the standard list implementation provided by the hstats package,

    $ time ./mean 
    3.141592653589793
    ./mean  26.80s user 0.08s system 99% cpu 26.965 total

And this package,

    $ time ./mean                      
    3.141592653589793
    ./mean  5.59s user 0.00s system 99% cpu 5.606 total

Synopsis

Documentation

mean :: Vector Double -> DoubleSource

A numerically stable mean.

required.

harmonic :: Vector Double -> DoubleSource

The harmonic mean

geometric :: Vector Double -> DoubleSource

The geometric mean of a non-negative list.

var :: Vector Double -> DoubleSource

A numerically stable variance.

stddev :: Vector Double -> DoubleSource

The standard deviation.