interface MonadSample : (Type -> Type) -> Type
- Parameters: m
Constraints: Monad m
Methods:
random : m Double
Draws a random value from Uniform(0,1)
uniform : Double -> Double -> m Double
Uniform(min, max)
normal : Double -> Double -> m Double
Normal(mean, sd)
gamma : Double -> Double -> m Double
Gamma(shape, scale) -> m Double
beta : Double -> Double -> m Double
Beta(alpha, beta) -> m Double
bernoulli : Double -> m Bool
Bernoulli(prob)
binomial : Nat -> Double -> m Nat
Binomial(num trials, prob of each trial)
categorical : Vect n Double -> m (Fin n)
Categorical(probs)
logCategorical : Vect n (Log Double) -> m (Fin n)
Log-categorical(log-probs)
uniformD : Vect (S n) a -> m a
Uniform-Discrete(values)
dirichlet : Vect n Double -> m (Vect n Double)
Dirichlet(concentrations)
discreteUniform : Nat -> m Nat
DiscUniform(range); should return Nat from 0 to (range - 1)
fromPMF : (Nat -> Double) -> m Nat
Draw from a discrete distribution using the probability mass function and a sequence of draws from Bernoulli.
geometric : Double -> m Nat
Geometric(prob)
hypergeometric : Nat -> Nat -> Nat -> m Nat
Hypergeometric(num elements of "type 1", num elements of "type 2", num samples)
poisson : Double -> m Nat
Poisson(λ)
Implementations:
MonadSample m => MonadSample (MaybeT m)
MonadSample m => MonadSample (ReaderT r m)
MonadSample m => MonadSample (WriterT w m)
MonadSample m => MonadSample (StateT s m)
MonadSample m => MonadSample (RWST r w s m)
random : MonadSample m => m Double
Draws a random value from Uniform(0,1)
Totality: total
Visibility: public exportuniform : MonadSample m => Double -> Double -> m Double
Uniform(min, max)
Totality: total
Visibility: public exportnormal : MonadSample m => Double -> Double -> m Double
Normal(mean, sd)
Totality: total
Visibility: public exportgamma : MonadSample m => Double -> Double -> m Double
Gamma(shape, scale) -> m Double
Totality: total
Visibility: public exportbeta : MonadSample m => Double -> Double -> m Double
Beta(alpha, beta) -> m Double
Totality: total
Visibility: public exportbernoulli : MonadSample m => Double -> m Bool
Bernoulli(prob)
Totality: total
Visibility: public exportbinomial : MonadSample m => Nat -> Double -> m Nat
Binomial(num trials, prob of each trial)
Totality: total
Visibility: public exportcategorical : MonadSample m => Vect n Double -> m (Fin n)
Categorical(probs)
Totality: total
Visibility: public exportlogCategorical : MonadSample m => Vect n (Log Double) -> m (Fin n)
Log-categorical(log-probs)
Totality: total
Visibility: public exportuniformD : MonadSample m => Vect (S n) a -> m a
Uniform-Discrete(values)
Totality: total
Visibility: public exportdirichlet : MonadSample m => Vect n Double -> m (Vect n Double)
Dirichlet(concentrations)
Totality: total
Visibility: public exportdiscreteUniform : MonadSample m => Nat -> m Nat
DiscUniform(range); should return Nat from 0 to (range - 1)
Totality: total
Visibility: public exportfromPMF : MonadSample m => (Nat -> Double) -> m Nat
Draw from a discrete distribution using the probability mass function and a sequence of draws from Bernoulli.
Totality: total
Visibility: public exportgeometric : MonadSample m => Double -> m Nat
Geometric(prob)
Totality: total
Visibility: public exporthypergeometric : MonadSample m => Nat -> Nat -> Nat -> m Nat
Hypergeometric(num elements of "type 1", num elements of "type 2", num samples)
Totality: total
Visibility: public exportpoisson : MonadSample m => Double -> m Nat
Poisson(λ)
Totality: total
Visibility: public exportinterface MonadCond : (Type -> Type) -> Type
- Parameters: m
Constraints: Monad m
Methods:
score : Log Double -> m ()
Record a likelihood. Note: when calling `score (Exp p)`, p must already be in the log-domain.
Implementations:
MonadCond m => MonadCond (MaybeT m)
MonadCond m => MonadCond (ReaderT r m)
MonadCond m => MonadCond (WriterT w m)
MonadCond m => MonadCond (StateT s m)
MonadCond m => MonadCond (RWST r w s m)
score : MonadCond m => Log Double -> m ()
Record a likelihood. Note: when calling `score (Exp p)`, p must already be in the log-domain.
Totality: total
Visibility: public exportcondition : MonadCond m => Bool -> m ()
- Totality: total
Visibility: export interface MonadInfer : (Type -> Type) -> Type
- Parameters: m
Constraints: MonadSample m, MonadCond m
Implementations:
MonadInfer m => MonadInfer (MaybeT m)
MonadInfer m => MonadInfer (ReaderT r m)
MonadInfer m => MonadInfer (WriterT w m)
MonadInfer m => MonadInfer (StateT s m)
MonadInfer m => MonadInfer (RWST r w s m)