hmatrix-gsl-stats-0.3.0.3: GSL Statistics interface

Numeric.GSL.Histogram2D

Description

GSL 2D histogram functions

http://www.gnu.org/software/gsl/manual/

Synopsis

# Creation

A histogram structure

Instances

 Eq Histogram2D Binary Histogram2D

Arguments

 :: Vector Double the x ranges -> Vector Double the y ranges -> Histogram2D result

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

Arguments

 :: Int -> Int bins -> (Double, Double) lower and upper limits x -> (Double, Double) lower and upper limits y -> Histogram2D result

create a histogram with n bins and lower and upper limits

Arguments

 :: Vector Double the x ranges -> Vector Double the y ranges -> [(Double, Double)] the data -> Histogram2D result

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

Arguments

 :: Int -> Int bins -> (Double, Double) x lower and upper limits -> (Double, Double) y lower and upper limits -> [(Double, Double)] the data -> Histogram2D result

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

addList :: Histogram2D -> [(Double, Double)] -> Histogram2D Source

add 1.0 to the correct bin for each element of the list, fails silently if the value is outside the range

add 1.0 to the correct bin for each element of the vector pair, fails silently if the value is outside the range

# Marshalling

Arguments

 :: Histogram2D -> (Vector Double, Vector Double, Matrix Double) (ranges,bins)

extract the ranges and bins

Arguments

 :: Vector Double x ranges -> Vector Double y ranges -> Matrix Double bins (row major) -> Histogram2D result

create from ranges and bins

# Information

getBin :: Histogram2D -> (Int, Int) -> Double Source

returns the contents of the i-th bin

returns the upper and lower limits in the first dimension of the i-th bin

returns the upper and lower limits in the second dimension of the i-th bin

the maximum upper range limit in the first dimension

the maximum upper range limit in the first dimension

the minimum lower range limit in the first dimension

the minimum lower range limit in the first dimension

the number of binsin the first dimension

the number of binsin the first dimension

reset :: Histogram2D -> IO () Source

reset all the bins to zero

# Querying

find :: Histogram2D -> (Double, Double) -> Maybe (Int, Int) Source

find the bin corresponding to the value

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

find the joint probability of occuring for each element of the input vector pair

find the joint probability of occuring for each element of the input vector pair

find the number of occurences 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

maxBin :: Histogram2D -> (Int, Int) Source

the index of the bin containing the maximum value

the minimum value contained in the bins

minBin :: Histogram2D -> (Int, Int) Source

the index of the bin containing the minimum value

# Statistics

the mean of the values in the first dimension, accuracy limited by bin width

the mean of the values in the second dimension, accuracy limited by bin width

the standard deviation of the values in thee first dimension, accuracy limited by bin width

the standard deviation of the values in thee first dimension, accuracy limited by bin width

the covariance of the first and second dimensions

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: xrange[i] xrange[i+1] xrange[j] xrange[j+1] bin(i,j)

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 randomm from the uniform distribution [0,1], draw a random sample from the PDF