Copyright | Copyright (c) 2009-2014, David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Tested with: GHC 7.8.3
This module defines the random parameters of simulation experiments.
To create a parameter that would return the same value within the simulation run,
you should memoize the computation with help of memoParameter
, which is important
for the Monte-Carlo simulation.
To create a random function that would return the same values in the integration
time points within the simulation run, you should either lift the computation to
the Dynamics
computation and then memoize it too but using the memo0Dynamics
function for that computation, or just take the predefined function that does
namely this.
- randomUniform :: MonadComp m => Double -> Double -> Parameter m Double
- randomUniformInt :: MonadComp m => Int -> Int -> Parameter m Int
- randomNormal :: MonadComp m => Double -> Double -> Parameter m Double
- randomExponential :: MonadComp m => Double -> Parameter m Double
- randomErlang :: MonadComp m => Double -> Int -> Parameter m Double
- randomPoisson :: MonadComp m => Double -> Parameter m Int
- randomBinomial :: MonadComp m => Double -> Int -> Parameter m Int
- randomTrue :: MonadComp m => Double -> Parameter m Bool
- randomFalse :: MonadComp m => Double -> Parameter m Bool
Documentation
Computation that generates a new random number distributed uniformly.
Computation that generates a new random integer number distributed uniformly.
Computation that generates a new random number distributed normally.
Computation that returns a new exponential random number with the specified mean (the reciprocal of the rate).
:: MonadComp m | |
=> Double | the scale (the reciprocal of the rate) |
-> Int | the shape |
-> Parameter m Double |
Computation that returns a new Erlang random number with the specified scale (the reciprocal of the rate) and integer shape.
Computation that returns a new Poisson random number with the specified mean.
Computation that returns a new binomial random number with the specified probability and trials.
Computation that returns True
in case of success.