mcmc-0.8.0.1: Sample from a posterior using Markov chain Monte Carlo
Copyright2021 Dominik Schrempf
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Mcmc.Prior

Description

Creation date: Thu Jul 23 13:26:14 2020.

Synopsis

Documentation

type Prior = Log Double Source #

Prior values are stored in log domain.

type PriorFunction a = a -> Log Double Source #

Prior function.

type PriorFunctionG a b = a -> Log b Source #

Generalized prior function.

Improper priors

noPrior :: RealFloat b => PriorFunctionG a b Source #

Flat prior function. Useful for testing and debugging.

greaterThan :: RealFloat a => LowerBoundary a -> PriorFunctionG a a Source #

Improper uniform prior; strictly greater than a given value.

positive :: RealFloat a => PriorFunctionG a a Source #

Improper uniform prior; strictly greater than zero.

lessThan :: RealFloat a => UpperBoundary a -> PriorFunctionG a a Source #

Improper uniform prior; strictly less than a given value.

negative :: RealFloat a => PriorFunctionG a a Source #

Improper uniform prior; strictly less than zero.

Continuous priors

exponential :: RealFloat a => Rate a -> PriorFunctionG a a Source #

Exponential distributed prior.

Call error if the rate is zero or negative.

gamma :: (Typeable a, RealFloat a) => Shape a -> Scale a -> PriorFunctionG a a Source #

Gamma distributed prior.

Call error if the shape or scale are zero or negative.

gammaMeanVariance :: (Typeable a, RealFloat a) => Mean a -> Variance a -> PriorFunctionG a a Source #

See gamma but parametrized using mean and variance.

gammaMeanOne :: (Typeable a, RealFloat a) => Shape a -> PriorFunctionG a a Source #

Gamma disstributed prior with given shape and mean 1.0.

gammaShapeScaleToMeanVariance :: Num a => Shape a -> Scale a -> (Mean a, Variance a) Source #

Calculate mean and variance of the gamma distribution given the shape and the scale.

gammaMeanVarianceToShapeScale :: Fractional a => Mean a -> Variance a -> (Shape a, Scale a) Source #

Calculate shape and scale of the gamma distribution given the mean and the variance.

logNormal :: RealFloat a => Mean a -> StandardDeviation a -> PriorFunctionG a a Source #

Log normal distributed prior.

NOTE: The log normal distribution is parametrized with the mean \(\mu\) and the standard deviation \(\sigma\) of the underlying normal distribution. The mean and variance of the log normal distribution itself are functions of \(\mu\) and \(\sigma\), but are not the same as \(\mu\) and \(\sigma\)!

Call error if the standard deviation is zero or negative.

normal :: RealFloat a => Mean a -> StandardDeviation a -> PriorFunctionG a a Source #

Normal distributed prior.

Call error if the standard deviation is zero or negative.

uniform :: RealFloat a => LowerBoundary a -> UpperBoundary a -> PriorFunctionG a a Source #

Uniform prior on [a, b].

Call error if the lower boundary is greather than the upper boundary.

Discrete priors

poisson :: (RealFloat a, Typeable a) => Rate a -> PriorFunctionG Int a Source #

Poisson distributed prior.

Call error if the rate is zero or negative.

Auxiliary functions

product' :: RealFloat a => [Log a] -> Log a Source #

Intelligent product that stops when encountering a zero.

Use with care because the elements are checked for positiveness, and this can take some time if the list is long and does not contain any zeroes.