| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
System.Random.MWC.Probability.Transition
Contents
- data Transition message s m a
- mkTransition :: Monad m => (s -> Prob m t) -> (s -> t -> (a, s)) -> (a -> s -> message) -> Transition message s m a
- runTransition :: Monad m => Handler m message -> Transition message s m a -> Int -> s -> Gen (PrimState m) -> m ([a], s)
- withSeverity :: (t -> String) -> WithSeverity t -> String
Transition
data Transition message s m a Source #
A Markov transition kernel.
Instances
| Functor m => Functor (Transition message s m) Source # | |
| Show (Transition msg s m a) Source # | |
Arguments
| :: Monad m | |
| => (s -> Prob m t) | Random generation |
| -> (s -> t -> (a, s)) | (Output, Next state) |
| -> (a -> s -> message) | Log message construction |
| -> Transition message s m a |
Construct a Transition from sampling, state transformation and logging functions.
NB: The three function arguments are used in the order in which they appear here:
- a random sample
w :: tis produced, using the current statex :: sas input - output
z :: aand next statex' :: sare computed usingwandx - a logging message is constructed, using
zandx'as arguments.
Arguments
| :: Monad m | |
| => Handler m message | Logging handler |
| -> Transition message s m a | |
| -> Int | Number of iterations |
| -> s | Initial state |
| -> Gen (PrimState m) | PRNG |
| -> m ([a], s) | (Outputs, Final state) |
Run a Transition for a number of steps, while logging each iteration.
Helper functions
withSeverity :: (t -> String) -> WithSeverity t -> String Source #
Render a logging message along with an annotation of its severity.