hmatrix-gsl-stats-0.3.0.1: GSL Statistics interface

Numeric.GSL.Histogram

Description

Synopsis

# Creation

data Histogram Source

A histogram structure

Instances

 Eq Histogram Binary Histogram

Arguments

 :: Vector Double the ranges -> Histogram result

create a histogram with n bins from ranges (x0->x1),(x1->x2)..(xn->xn+1)

Arguments

 :: Int bins -> (Double, Double) lower and upper limits -> Histogram result

create a histogram with n bins and lower and upper limits

Arguments

 :: Vector Double the ranges -> Vector Double the data -> Histogram result

create a histogram with n bins from ranges (x0->x1),(x1->x2)..(xn->xn+1) and increment from a vector

Arguments

 :: Int bins -> (Double, Double) lower and upper limits -> Vector Double the data -> Histogram result

create a histogram with n bins and lower and upper limits and increment from a vector

addList :: Histogram -> [Double] -> Histogram Source

adds 1.0 to the correct bin for each element of the list

adds 1.0 to the correct bin for each element of the vector

addListWeighted :: Histogram -> [(Double, Double)] -> Histogram Source

adds the appropriate weight for each element of the list

adds the appropriate weight for each element of the list

# Marshalling

Arguments

 :: Histogram -> (Vector Double, Vector Double) (ranges,bins)

extract the ranges and bin weights

create a histogram from the ranges and bin weights

# Information

returns the contents of the i-th bin

getRange :: Histogram -> Int -> (Double, Double) Source

returns the upper and lower limits of the i-th bin

the maximum upper range limit

the minimum lower range limit

the number of bins

# Querying

find the bin corresponding to the value

find the number of occurences for each element of the input vector

find the probability of occurring for each element of the input vector

find the number of occurences for the input

find the probability of the input

the maximum value contained in the bins

the index of the bin containing the maximum value

the minimum value contained in the bins

the index of the bin containing the minimum value

# Statistics

the mean of the values, accuracy limited by bin width

the standard deviation of the values, accuracy limited by bin width

the sum of the values, accuracy limited by bin width

returns True of all the individual bin ranges of the two histograms are identical

# Mathematics

adds the contents of the bins of the second histogram to the first

subtracts the contents of the bins of the second histogram from the first

multiplies the contents of the bins of the second histogram by the first

divides the contents of the bins of the first histogram by the second

adds a constant to the contents of the bins

multiplies the contents of the bins by a constant

# Files

write a histogram in the native binary format (may not be portable)

read a histogram in the native binary format, number of bins must be known

saves the histogram with the given formats (%f,%e,%g) for ranges and bins each line comprises: range[i] range[i+1] bin[i]

reads formatted data as written by fprintf, the number of bins must be known in advance

# PDF

A histogram-derived cumulative distribution function (CDF)

create a histogram PDF from a histogram

given a random number from the uniform distribution [0,1], draw a random sample from the PDF