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

Portability portable experimental bos@serpentine.com

Statistics.Distribution

Description

Types and functions common to many probability distributions.

Synopsis

# Documentation

class Distribution d whereSource

The interface shared by all probability distributions.

Methods

probability :: d -> Double -> DoubleSource

Probability density function. The probability that a stochastic variable x has the value X, i.e. P(x=X).

cumulative :: d -> Double -> DoubleSource

Cumulative distribution function. The probability that a stochastic variable x is less than X, i.e. P(x<X).

inverse :: d -> Double -> DoubleSource

Inverse of the cumulative distribution function. The value X for which P(x<X).

class Distribution d => Mean d whereSource

Methods

mean :: d -> DoubleSource

Arguments

 :: Distribution d => d -> Double Probability p -> Double Initial guess -> Double Lower bound on interval -> Double Upper bound on interval -> Double

Approximate the value of X for which P(x>X)=p.

This method uses a combination of Newton-Raphson iteration and bisection with the given guess as a starting point. The upper and lower bounds specify the interval in which the probability distribution reaches the value p.