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 functions that always return the same values in the integration time points within a single simulation run. The values for another simulation run will be regenerated anew.
For example, the computations returned by these functions can be used in the equations of System Dynamics.
Also it is worth noting that the values are generated in a strong order starting
from starttime
with step dt
. This is how the memo0Dynamics
function
actually works.
Synopsis
- memoRandomUniformDynamics :: MonadSD m => Dynamics m Double -> Dynamics m Double -> Simulation m (Dynamics m Double)
- memoRandomUniformIntDynamics :: MonadSD m => Dynamics m Int -> Dynamics m Int -> Simulation m (Dynamics m Int)
- memoRandomTriangularDynamics :: MonadSD m => Dynamics m Double -> Dynamics m Double -> Dynamics m Double -> Simulation m (Dynamics m Double)
- memoRandomNormalDynamics :: MonadSD m => Dynamics m Double -> Dynamics m Double -> Simulation m (Dynamics m Double)
- memoRandomLogNormalDynamics :: MonadSD m => Dynamics m Double -> Dynamics m Double -> Simulation m (Dynamics m Double)
- memoRandomExponentialDynamics :: MonadSD m => Dynamics m Double -> Simulation m (Dynamics m Double)
- memoRandomErlangDynamics :: MonadSD m => Dynamics m Double -> Dynamics m Int -> Simulation m (Dynamics m Double)
- memoRandomPoissonDynamics :: MonadSD m => Dynamics m Double -> Simulation m (Dynamics m Int)
- memoRandomBinomialDynamics :: MonadSD m => Dynamics m Double -> Dynamics m Int -> Simulation m (Dynamics m Int)
- memoRandomGammaDynamics :: MonadSD m => Dynamics m Double -> Dynamics m Double -> Simulation m (Dynamics m Double)
- memoRandomBetaDynamics :: MonadSD m => Dynamics m Double -> Dynamics m Double -> Simulation m (Dynamics m Double)
- memoRandomWeibullDynamics :: MonadSD m => Dynamics m Double -> Dynamics m Double -> Simulation m (Dynamics m Double)
- memoRandomDiscreteDynamics :: (MonadSD m, MonadMemo m a) => Dynamics m (DiscretePDF a) -> Simulation m (Dynamics m a)
Documentation
memoRandomUniformDynamics Source #
:: MonadSD m | |
=> Dynamics m Double | minimum |
-> Dynamics m Double | maximum |
-> Simulation m (Dynamics m Double) |
Computation that generates random numbers distributed uniformly and memoizes them in the integration time points.
memoRandomUniformIntDynamics Source #
Computation that generates random integer numbers distributed uniformly and memoizes them in the integration time points.
memoRandomTriangularDynamics Source #
:: MonadSD m | |
=> Dynamics m Double | minimum |
-> Dynamics m Double | median |
-> Dynamics m Double | maximum |
-> Simulation m (Dynamics m Double) |
Computation that generates random numbers from the triangular distribution and memoizes the numbers in the integration time points.
memoRandomNormalDynamics Source #
:: MonadSD m | |
=> Dynamics m Double | mean |
-> Dynamics m Double | deviation |
-> Simulation m (Dynamics m Double) |
Computation that generates random numbers distributed normally and memoizes them in the integration time points.
memoRandomLogNormalDynamics Source #
:: MonadSD m | |
=> Dynamics m Double | the mean of a normal distribution which this distribution is derived from |
-> Dynamics m Double | the deviation of a normal distribution which this distribution is derived from |
-> Simulation m (Dynamics m Double) |
Computation that generates random numbers from the lognormal distribution and memoizes the numbers in the integration time points.
memoRandomExponentialDynamics Source #
:: MonadSD m | |
=> Dynamics m Double | the mean (the reciprocal of the rate) |
-> Simulation m (Dynamics m Double) |
Computation that generates exponential random numbers with the specified mean (the reciprocal of the rate) and memoizes them in the integration time points.
memoRandomErlangDynamics Source #
:: MonadSD m | |
=> Dynamics m Double | the scale (the reciprocal of the rate) |
-> Dynamics m Int | the shape |
-> Simulation m (Dynamics m Double) |
Computation that generates the Erlang random numbers with the specified scale (the reciprocal of the rate) and integer shape but memoizes them in the integration time points.
memoRandomPoissonDynamics Source #
Computation that generats the Poisson random numbers with the specified mean and memoizes them in the integration time points.
memoRandomBinomialDynamics Source #
:: MonadSD m | |
=> Dynamics m Double | the probability |
-> Dynamics m Int | the number of trials |
-> Simulation m (Dynamics m Int) |
Computation that generates binomial random numbers with the specified probability and trials but memoizes them in the integration time points.
memoRandomGammaDynamics Source #
:: MonadSD m | |
=> Dynamics m Double | shape |
-> Dynamics m Double | scale (a reciprocal of the rate) |
-> Simulation m (Dynamics m Double) |
Computation that generates random numbers from the Gamma distribution with the specified shape and scale but memoizes the numbers in the integration time points.
memoRandomBetaDynamics Source #
:: MonadSD m | |
=> Dynamics m Double | shape (alpha) |
-> Dynamics m Double | shape (beta) |
-> Simulation m (Dynamics m Double) |
Computation that generates random numbers from the Beta distribution by the specified shape parameters and memoizes the numbers in the integration time points.
memoRandomWeibullDynamics Source #
Computation that generates random numbers from the Weibull distribution with the specified shape and scale but memoizes the numbers in the integration time points.
memoRandomDiscreteDynamics :: (MonadSD m, MonadMemo m a) => Dynamics m (DiscretePDF a) -> Simulation m (Dynamics m a) Source #
Computation that generates random values from the specified discrete distribution and memoizes the values in the integration time points.