Portability | uses ffi |
---|---|
Stability | provisional |
Maintainer | haskell.vivian.mcphail <at> gmail <dot> com |
GSL histogram functions
- data Histogram
- fromRanges :: Vector Double -> Vector Double -> Histogram
- fromLimits :: Int -> (Double, Double) -> Vector Double -> Histogram
- addList :: Histogram -> [Double] -> Histogram
- addVector :: Histogram -> Vector Double -> Histogram
- addListWeighted :: Histogram -> [(Double, Double)] -> Histogram
- addVectorWeighted :: Histogram -> Vector Double -> Vector Double -> Histogram
- toVectors :: Histogram -> (Vector Double, Vector Double)
- getBin :: Histogram -> Int -> Double
- getRange :: Histogram -> Int -> (Double, Double)
- getMax :: Histogram -> Double
- getMin :: Histogram -> Double
- getBins :: Histogram -> Int
- find :: Histogram -> Double -> Maybe Int
- maxVal :: Histogram -> Double
- maxBin :: Histogram -> Int
- minVal :: Histogram -> Double
- minBin :: Histogram -> Int
- mean :: Histogram -> Double
- stddev :: Histogram -> Double
- sum :: Histogram -> Double
- equalBins :: Histogram -> Histogram -> Bool
- add :: Histogram -> Histogram -> Histogram
- subtract :: Histogram -> Histogram -> Histogram
- multiply :: Histogram -> Histogram -> Histogram
- divide :: Histogram -> Histogram -> Histogram
- shift :: Histogram -> Double -> Histogram
- scale :: Histogram -> Double -> Histogram
- fwriteHistogram :: FilePath -> Histogram -> IO ()
- freadHistogram :: FilePath -> Int -> IO Histogram
- fprintfHistogram :: FilePath -> String -> String -> Histogram -> IO ()
- fscanfHistogram :: FilePath -> Int -> IO Histogram
- data HistogramPDF
- fromHistogram :: Histogram -> HistogramPDF
- sample :: HistogramPDF -> Double
Documentation
create a histogram with n bins from ranges (x0->x1),(x1->x2)..(xn->xn+1) and increment from a vector
create a histogram with n bins and lower and upper limits and increment from a vector
addList :: Histogram -> [Double] -> HistogramSource
adds 1.0 to the correct bin for each element of the list
addVector :: Histogram -> Vector Double -> HistogramSource
adds 1.0 to the correct bin for each element of the vector
addListWeighted :: Histogram -> [(Double, Double)] -> HistogramSource
adds the appropriate weight for each element of the list
addVectorWeighted :: Histogram -> Vector Double -> Vector Double -> HistogramSource
adds the appropriate weight for each element of the list
extract the ranges and bins
getRange :: Histogram -> Int -> (Double, Double)Source
returns the upper and lower limits of the i-th bin
stddev :: Histogram -> DoubleSource
the standard deviation of the values, accuracy limited by bin width
equalBins :: Histogram -> Histogram -> BoolSource
returns True of all the individual bin ranges of the two histograms are identical
add :: Histogram -> Histogram -> HistogramSource
adds the contents of the bins of the second histogram to the first
subtract :: Histogram -> Histogram -> HistogramSource
subtracts the contents of the bins of the second histogram from the first
multiply :: Histogram -> Histogram -> HistogramSource
multiplies the contents of the bins of the second histogram by the first
divide :: Histogram -> Histogram -> HistogramSource
divides the contents of the bins of the first histogram by the second
fwriteHistogram :: FilePath -> Histogram -> IO ()Source
write a histogram in the native binary format (may not be portable)
freadHistogram :: FilePath -> Int -> IO HistogramSource
read a histogram in the native binary format, number of bins must be known
fprintfHistogram :: FilePath -> String -> String -> Histogram -> IO ()Source
saves the histogram with the given formats (%f,%e,%g) for ranges and bins each line comprises: range[i] range[i+1] bin[i]
fscanfHistogram :: FilePath -> Int -> IO HistogramSource
reads formatted data as written by fprintf, the number of bins must be known in advance
data HistogramPDF Source
A histogram-derived cumulative distribution function (CDF)
fromHistogram :: Histogram -> HistogramPDFSource
create a histogram PDF from a histogram
sample :: HistogramPDF -> DoubleSource
given a randomm from the uniform distribution [0,1], draw a random sample from the PDF