Copyright | (c) Dominik Schrempf 2021 |
---|---|
License | GPL-3.0-or-later |
Maintainer | dominik.schrempf@gmail.com |
Stability | unstable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Creation date: Thu Jul 23 13:26:14 2020.
Synopsis
- type Prior = PriorG Double
- type PriorG a = Log a
- type PriorFunction a = PriorFunctionG a Double
- type PriorFunctionG a b = a -> PriorG 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 :: RealFloat a => Shape a -> Scale a -> PriorFunctionG a a
- gammaMeanVariance :: RealFloat a => Mean a -> Variance a -> PriorFunctionG a a
- gammaMeanOne :: 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)
- normal :: RealFloat a => Mean a -> StandardDeviation a -> PriorFunctionG a a
- uniform :: RealFloat a => LowerBoundary a -> UpperBoundary a -> PriorFunctionG a a
- poisson :: Rate Double -> PriorFunction Int
- product' :: RealFloat a => [Log a] -> Log a
Documentation
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 :: 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 :: RealFloat a => Mean a -> Variance a -> PriorFunctionG a a Source #
See gamma
but parametrized using mean and variance.
gammaMeanOne :: 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.