Copyright | 2021 Dominik Schrempf |
---|---|
License | GPL-3.0-or-later |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Creation date: Thu Jul 23 13:26:14 2020.
Synopsis
- type Prior = Log Double
- type PriorFunction a = a -> Log Double
- type PriorFunctionG a b = a -> Log b
- noPrior :: RealFloat b => PriorFunctionG a b
- greaterThan :: RealFloat a => LowerBoundary a -> PriorFunctionG a a
- positive :: RealFloat a => PriorFunctionG a a
- lessThan :: RealFloat a => UpperBoundary a -> PriorFunctionG a a
- negative :: RealFloat a => PriorFunctionG a a
- exponential :: RealFloat a => Rate a -> PriorFunctionG a a
- gamma :: (Typeable a, RealFloat a) => Shape a -> Scale a -> PriorFunctionG a a
- gammaMeanVariance :: (Typeable a, RealFloat a) => Mean a -> Variance a -> PriorFunctionG a a
- gammaMeanOne :: (Typeable a, RealFloat a) => Shape a -> PriorFunctionG a a
- gammaShapeScaleToMeanVariance :: Num a => Shape a -> Scale a -> (Mean a, Variance a)
- gammaMeanVarianceToShapeScale :: Fractional a => Mean a -> Variance a -> (Shape a, Scale a)
- logNormal :: RealFloat a => Mean a -> StandardDeviation a -> PriorFunctionG a a
- normal :: RealFloat a => Mean a -> StandardDeviation a -> PriorFunctionG a a
- uniform :: RealFloat a => LowerBoundary a -> UpperBoundary a -> PriorFunctionG a a
- poisson :: (RealFloat a, Typeable a) => Rate a -> PriorFunctionG Int a
- product' :: RealFloat a => [Log a] -> Log a
Documentation
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.