mcmc-0.6.2.4: 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 = PriorG Double Source #

Prior values are stored in log domain.

type PriorG a = Log a Source #

Generalized prior.

type PriorFunction a = PriorFunctionG a Double Source #

Prior function.

type PriorFunctionG a b = a -> PriorG 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.

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 :: Rate Double -> PriorFunction Int 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.