diversity-0.8.1.0: Quantify the diversity of a population

Safe HaskellNone
LanguageHaskell98

Math.Diversity.Diversity

Description

Collection of functions pertaining to finding the diversity of samples.

Synopsis

Documentation

hamming :: String -> String -> Int Source #

Takes two strings, returns Hamming distance

richness :: (Ord a, Ord b) => Map (a, b) c -> Int Source #

Returns the richness of the observed data

diversity :: Ord a => Double -> [a] -> Double Source #

Returns the diversity of a list of things

diversityOfMap :: Ord a => Double -> Map a Int -> Double Source #

Returns the diversity of a map of the species and how many times it appears

diversityOfMapWithContribution :: Ord a => Double -> Map a Int -> (Double, Map a Double) Source #

Returns the diversity of a map of the species and how many times it appears, along with the contribution of each species.

chao1 :: Ord a => Map a Int -> Double Source #

Returns the chao1 estimator of a map of the species and how many times it appears

chao2 :: (Ord a, Ord b) => Map (a, b) Int -> Double Source #

Returns the chao2 estimator of a map of the sample labeled species (sample, species) and how many times it appears. This will calculate the overlap for you, so if you don't have the number of times it appears it does not matter, you can set it to 1 and get the same result as it's all about overlapping samples.

chao1Var :: Ord a => Map a Int -> Double Source #

Returns the chao1 estimator variance of a map of the species and how many times each one appears.

chao2Var :: (Ord a, Ord b) => Map (a, b) Int -> Double Source #

Returns the chao2 estimator variance of a map of the sample labeled species (sample, species) and how many times it appears.

rarefactionCurve :: Bool -> Int -> Integer -> Integer -> Integer -> Map (Sample, Fragment) Int -> IO [(Int, Maybe (Double, Double))] Source #

Returns the rarefaction curve for each position in a list

rarefactionSampleCurve :: Bool -> Int -> Int -> Int -> Map (Sample, Fragment) Int -> IO [(Int, Maybe (Double, Double))] Source #

Returns the rarefaction curve for each position in a list

rarefactionViable :: [Double] -> Double Source #

Calculates the percent of the curve that is above 95% of height of the curve

individualG :: Double -> Map (Sample, Fragment) Int -> Double Source #

Returns the number of individuals needed to get the proportion g of the estimated total richness of the assemblage. Sobs / Sest < g < 1

sampleG :: Double -> Map (Sample, Fragment) Int -> Double Source #

Returns the number of samples needed to get the proportion g of the estimated total richness of the assemblage. Sobs / Sest < g < 1

minRarefaction :: Bool -> Bool -> Int -> Map (Sample, Fragment) Int -> Double -> Int -> IO Int Source #

Returns the number of samples needed before a new sample returns less than x new species. Warning, goes forever until threshold is met!