aivika-1.2: A multi-paradigm simulation library

Stabilityexperimental
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Safe HaskellSafe-Inferred

Simulation.Aivika.Parameter.Random

Description

Tested with: GHC 7.6.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.

Synopsis

Documentation

randomUniformSource

Arguments

:: Double

minimum

-> Double

maximum

-> Parameter Double 

Computation that generates a new random number distributed uniformly.

randomNormalSource

Arguments

:: Double

mean

-> Double

deviation

-> Parameter Double 

Computation that generates a new random number distributed normally.

randomExponentialSource

Arguments

:: Double

the mean (the reciprocal of the rate)

-> Parameter Double 

Computation that returns a new exponential random number with the specified mean (the reciprocal of the rate).

randomErlangSource

Arguments

:: Double

the scale (the reciprocal of the rate)

-> Int

the shape

-> Parameter Double 

Computation that returns a new Erlang random number with the specified scale (the reciprocal of the rate) and integer shape.

randomPoissonSource

Arguments

:: Double

the mean

-> Parameter Int 

Computation that returns a new Poisson random number with the specified mean.

randomBinomialSource

Arguments

:: Double

the probability

-> Int

the number of trials

-> Parameter Int 

Computation that returns a new binomial random number with the specified probability and trials.

randomTrueSource

Arguments

:: Double

the probability of the success

-> Parameter Bool 

Computation that returns True in case of success.

randomFalseSource

Arguments

:: Double

the probability of the success

-> Parameter Bool 

Computation that returns False in case of success.