Description
Returns and stores an input sample based on a particular distribution during a simulation. The same distributions available in @RISK are available in the RDK. For more information see the @RISK Distribution Functions section of this manual.
Syntax
myInput.RISK<distname>(stdArgs as Double, Optional shift as Double = 0, Optional truncMin as Double = -Infinity, Optional truncMax as Double = +Infinity)
Arguments
stdArgs (Required Double or array of Doubles) – one or more double values or arrays of doubles which are the required arguments for the specific distribution type.
shift (Optional Double) – an optional "location" parameter, which allows a simple shift of distributions that do not have an intrinsic location parameter. Note: While all RISK<distname> distributions support the use of shift factors, in some cases using them may lead to confusion. For example, the first standard argument of the Normal distribution is a location parameter and thus the use of a shift factor might be confusing.
truncMin (Optional Double) – the minimum truncation value. The distribution will not return values below this minimum value.
truncMax (Optional Double) – the maximum truncation value. The distribution will not return values above this minimum value.
Return Value
(Double) – A sample from the given distribution.
Example
'Sample some inputs during a simulation
With RDKApp
'A normal with mean=100 and stdDev = 10
.Inputs("InputA").RISKNormal(100,10)
'A exponential with B=2, and location 5
.Inputs("InputB").RISKExpon(2,,,5)
End With