aivika-transformers-6.1.1: Transformers for the Aivika simulation library
CopyrightCopyright (c) 2009-2017 David Sorokin <david.sorokin@gmail.com>
LicenseBSD3
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simulation.Aivika.Trans.Parameter.Random

Description

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

Documentation

randomUniform Source #

Arguments

:: MonadComp m 
=> Double

minimum

-> Double

maximum

-> Parameter m Double 

Computation that generates a new random number distributed uniformly.

randomUniformInt Source #

Arguments

:: MonadComp m 
=> Int

minimum

-> Int

maximum

-> Parameter m Int 

Computation that generates a new random integer number distributed uniformly.

randomTriangular Source #

Arguments

:: MonadComp m 
=> Double

minimum

-> Double

median

-> Double

maximum

-> Parameter m Double 

Computation that generates a new random number from the triangular distribution.

randomNormal Source #

Arguments

:: MonadComp m 
=> Double

mean

-> Double

deviation

-> Parameter m Double 

Computation that generates a new random number distributed normally.

randomLogNormal Source #

Arguments

:: MonadComp m 
=> 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 m Double 

Computation that generates a new random number from the lognormal distribution.

randomExponential Source #

Arguments

:: MonadComp m 
=> Double

the mean (the reciprocal of the rate)

-> Parameter m Double 

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

randomErlang Source #

Arguments

:: 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.

randomPoisson Source #

Arguments

:: MonadComp m 
=> Double

the mean

-> Parameter m Int 

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

randomBinomial Source #

Arguments

:: MonadComp m 
=> Double

the probability

-> Int

the number of trials

-> Parameter m Int 

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

randomGamma Source #

Arguments

:: MonadComp m 
=> Double

the shape

-> Double

the scale (a reciprocal of the rate)

-> Parameter m Double 

Computation that returns a new random number from the Gamma distribution.

randomBeta Source #

Arguments

:: MonadComp m 
=> Double

the shape (alpha)

-> Double

the shape (beta)

-> Parameter m Double 

Computation that returns a new random number from the Beta distribution.

randomWeibull Source #

Arguments

:: MonadComp m 
=> Double

shape

-> Double

scale

-> Parameter m Double 

Computation that returns a new random number from the Weibull distribution.

randomDiscrete :: MonadComp m => DiscretePDF a -> Parameter m a Source #

Computation that returns a new random value from the specified discrete distribution.

randomTrue Source #

Arguments

:: MonadComp m 
=> Double

the probability of the success

-> Parameter m Bool 

Computation that returns True in case of success.

randomFalse Source #

Arguments

:: MonadComp m 
=> Double

the probability of the success

-> Parameter m Bool 

Computation that returns False in case of success.