Copyright | Copyright (c) 2009-2017 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 8.0.1
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.
Synopsis
- randomUniform :: Double -> Double -> Parameter Double
- randomUniformInt :: Int -> Int -> Parameter Int
- randomTriangular :: Double -> Double -> Double -> Parameter Double
- randomNormal :: Double -> Double -> Parameter Double
- randomLogNormal :: Double -> Double -> Parameter Double
- randomExponential :: Double -> Parameter Double
- randomErlang :: Double -> Int -> Parameter Double
- randomPoisson :: Double -> Parameter Int
- randomBinomial :: Double -> Int -> Parameter Int
- randomGamma :: Double -> Double -> Parameter Double
- randomBeta :: Double -> Double -> Parameter Double
- randomWeibull :: Double -> Double -> Parameter Double
- randomDiscrete :: DiscretePDF a -> Parameter a
- randomTrue :: Double -> Parameter Bool
- randomFalse :: Double -> Parameter 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 from the triangular distribution.
Computation that generates a new random number distributed normally.
:: Double | the mean of a normal distribution which this distribution is derived from |
-> Double | the deviation of a normal distribution which this distribution is derived from |
-> Parameter Double |
Computation that generates a new random number from the lognormal distribution.
Computation that returns a new exponential random number with the specified mean (the reciprocal of the rate).
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 a new random number from the Gamma distribution.
Computation that returns a new random number from the Beta distribution.
Computation that returns a new random number from the Weibull distribution.
randomDiscrete :: DiscretePDF a -> Parameter a Source #
Computation that returns a new random value from the specified discrete distribution.
Computation that returns True
in case of success.