Skip to content

RiskFunctions

pyscripter edited this page Apr 5, 2020 · 9 revisions

XLRisk distribution functions

To describe the uncertainty in your model you can use the distribution functions provided by XLRisk (also referred to as risk functions). The list of these functions is currently short, but it will be expanded in the near future.

Depeanding on the "Show samples" setting these functions, when entered into the spreadsheet, they will return (shhow), either a sample of the distribution or its mean value. You can enter these functions using the Excel "Insert function" dialog box.

List of distribution functions

  • RiskNormal(mean, stdev): Generates samples from a normal distribution, with the given mean and standard deviation.
  • RiskUniform(min, max): Generates samples from a unifor distribution between min and max.
  • RiskTriang(min, most likely, max): Generates samples from a triangular distribution, with the given minimum most-likely and maximum value.
  • RiskBeta(alpha, beta, A, B): Generates samples from a beta distribution, with the given shape parameters alpha and beta. Optionally provide A and B as the minimum and maximum. The parameters are the same as in the built-in BETA.INV function.
  • RiskPert(min, most likely, max): Generates samples from a PERT distribution, with the given minimum most-likely and maximum value. The PERT distribution is a special case of the Beta distribution and can be used as a smoother version of the Triangular distribution.
  • RiskLogNormal(meand, stdev): Generates samples from a log-normal distribution, with the given meand and standard deviation.
  • RiskDUniform(Values): Generates samples from a discrete uniform distribution. The arguement Values can be a range or an array of values. Each of the values has equal chance of being sampled.
  • RiskCumul(minvalue, maxvalue, XValues, YValues): Generates samples from a cumulative distribution, specified by the minimum, maximum values and two arrays containing the X and Y coordinates of the remaining points. The Y coordinates are cumulative probabilities. XValues and YValues need to be in strictly increasing order. The XValues need to be between the minimum and maximum values.

Other functions

  • RiskCorrmat(CorrmatRng, Index): When added as an optional last argument to a Risk function it creates a link to a correlation matrix. See how to use it in the Correlated Inputs Example.
  • RiskIsValidCorrmat(CorrmatRng): Checks whether a correlation matrix is valid including a test for semipositive definiteness. Returns a Boolean value.
  • RiskCorrectCorrmat(CorrmatRng): Fixes an correlation matrix that is not semipositive definite and returns a valid correlation matrix.