mcmc-0.5.0.0: Sample from a posterior using Markov chain Monte Carlo
Copyright(c) Dominik Schrempf 2021
LicenseGPL-3.0-or-later
Maintainerdominik.schrempf@gmail.com
Stabilityunstable
Portabilityportable
Safe HaskellNone
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 -> Prior Source #

Prior function.

noPrior :: PriorFunction a Source #

Flat prior function. Useful for testing and debugging.

Improper priors

largerThan :: LowerBoundary -> PriorFunction Double Source #

Improper uniform prior; strictly larger than a given value.

positive :: PriorFunction Double Source #

Improper uniform prior; strictly larger than zero.

lowerThan :: UpperBoundary -> PriorFunction Double Source #

Improper uniform prior; strictly lower than a given value.

negative :: PriorFunction Double Source #

Improper uniform prior; strictly lower than zero.

Continuous priors

exponential :: Rate -> PriorFunction Double Source #

Exponential distributed prior.

gamma :: Shape -> Scale -> PriorFunction Double Source #

Gamma distributed prior.

gammaMeanVariance :: Mean -> Variance -> PriorFunction Double Source #

See gamma but parametrized using mean and variance.

gammaMeanOne :: Shape -> PriorFunction Double Source #

Gamma disstributed prior with given shape and mean 1.0.

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

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

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

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

normal :: Mean -> StandardDeviation -> PriorFunction Double Source #

Normal distributed prior.

Discrete priors

poisson :: Rate -> PriorFunction Int Source #

Poisson distributed prior.

Auxiliary functions

product' :: [Log Double] -> Log Double 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.