Idris2Doc : Control.Monad.Bayes.Weighted

Control.Monad.Bayes.Weighted

(source)
Weighted is an instance of MonadCond. Apply a MonadSample transformer to
obtain a MonadInfer that can execute probabilistic models.

Reexports

import public Control.Monad.State
import public Numeric.Log

Definitions

record Weighted : (Type -> Type) -> Type -> Type
  Execute the program using the prior distribution, while accumulating likelihood.

Totality: total
Visibility: public export
Constructor: 
MkWeighted : StateT (Log Double) m a -> Weighted m a

Projection: 
.runWeighted' : Weighted m a -> StateT (Log Double) m a

Hints:
Monad m => Applicative (Weighted m)
Functor m => Functor (Weighted m)
Monad m => Monad (Weighted m)
Monad m => MonadCond (Weighted m)
MonadSample m => MonadInfer (Weighted m)
MonadSample m => MonadSample (Weighted m)
MonadTrans Weighted
.runWeighted' : Weighted m a -> StateT (Log Double) m a
Visibility: public export
runWeighted' : Weighted m a -> StateT (Log Double) m a
Visibility: public export
runWeighted : Weighted m a -> m (Log Double, a)
  Obtain an explicit value of the likelihood for a given value

Visibility: public export
prior : Functor m => Weighted m a -> m a
  Compute the sample and discard the weight.
This operation introduces bias.

Visibility: export
extractWeight : Functor m => Weighted m a -> m (Log Double)
  Compute the weight and discard the sample.

Visibility: export
withWeight : Monad m => m (Log Double, a) -> Weighted m a
  Embed a random variable with explicitly given likelihood

Visibility: export
flatten : Monad m => Weighted (Weighted m) a -> Weighted m a
  Combine weights from two different levels.

Visibility: export
applyWeight : MonadCond m => Weighted m a -> m a
  Use the weight as a factor in the transformed monad.

Visibility: export
hoist : (m x -> n x) -> Weighted m a -> Weighted n a
  Apply a transformation to the transformed monad.

Visibility: export