RiskAMP Reference
RiskAMP Reference
_______________________________________
RiskAMP Version
Structured Data, LLC
.
RiskAMP is a trademark of Strucuted Data, LLC. Excel® is a registered trademark of Microsoft Corporation. Other
trademarks are held by their respective owners. For more information, visit our website at http://www.riskamp.com.
In order to most effectively utilize the calculation and modeling abilities of Excel, the RiskAMP add-in
stores all simulation results within the spreadsheet, so that subsequent functions can analyze the
simulation results and generate a statistical analysis.
For each iteration of a probability simulation, the entire spreadsheet is recalculated. In a typical
simulation, this can happen hundreds or thousands of times. For the subsequent analysis, we need to
reach back over each iteration and find values from the calculated spreadsheet.
It's not practical to store the contents of every cell in the spreadsheet for each iteration. This would use
up a lot of memory and add to the processing time. Therefore, the RiskAMP add-in uses a concept of
Reference Cells. Basically, the idea is that a simulation function – one of the RiskAMP statistical
analysis functions – must refer to a cell in the spreadsheet before the data from that cell is stored.
For each reference cell – each cell that is referred to by a simulation function – the probability
simulation engine stores the value of that cell at each iteration of a simulation. That means that every
value of that cell can later be retrieved, and the cell can be used as the basis for later analysis.
One of the most useful features of the reference cell concept is that once the cell data is stored, it can be
used for any simulation analysis function – even functions that were not originally intended to be used.
This allows users of the add-in to explore data and statistics after the simulation has completed,
changing parameters and reviewing the model, withing re-running the simulation. Of course the
simulation can be re-run at any time, to generate new data or to modify the simulation model.
Many of the simulation analysis and statistics functions in the RiskAMP add-in use the concept of
Reference Cells. During a probability simulation, the entire spreadsheet is recalculated. Any cells
containing random variables (using the RiskAMP random functions or built-in Excel random functions)
will be populated with new values.
In addition, the reference cell can be any cell in a spreadsheet – not just one of the RiskAMP random
distribution functions. That means that any value, or function result, can form the basis of a probability
simulation. You are not limited to the random functions the add-in provides.
Simulation functions are used to analyze the results of a probability simulation, after the simulation has
run. In general, simulation functions take one or more Reference Cells as parameters (in addition to
any additional parameters); see the section on Reference Cells for more information on the concept.
Simulation functions can return both statistical values (i.e. analyses of the complete simulation) and
discrete results (i.e. results from a particular iteration of the simulation).
SimulationAverage
SimulationCorrelation
SimulationCovariance
SimulationInterval
SimulationKurtosis
SimulationMax
SimulationMean
SimulationMedian
SimulationMin
SimulationMode
SimulationPercentile
SimulationSkewness
SimulationStandardDeviation
SimulationTrials
SimulationValue
SimulationVariance
SortedSimulationIndex
Example: = SIMULATIONAVERAGE( A1 )
The SimulationAverage function returns the mean, or average value, of the reference cell over all
iterations of the simulation.
The SimulationCorrelation function returns the observed correlation between any two spreadsheet cells
over all iterations of the most recently run simulation.
The SimulationCovariance function returns the observed covariance between any two spreadsheet cells
over all iterations of the most recently run simulation.
The SimulationInterval function returns the probability (expressed as a percent) that over all iterations
of the simulation, the observed value of the reference cell falls between the given minimum and
maximum values.
If the minimum value is omitted, the function will return the probability that the value lies below the
given maximum; similarly, if the maximum value is omitted, the function will return the probability
that the value lies above the given minimum.
This function is used to determine the probability, after running a simulation, that a particular value
will be reached or achieved. For example, in a project planning model, the function can be used to
determine the likelihood – using a probability simulation – that the project will be completed on
schedule, or within certain tolerances (one month, two months, etc).
Example: = SIMULATIONINTERVAL( A1 )
The SimulationKurtosis function returns the kurtosis of the reference cell, over all iterations of the most
recently run simulation. Kurtosis is the degree of peakedness of a distribution, relative to a normal
distribution. Perfectly normally-distributed data will have kurtosis of 3.
Example: = SIMULATIONMAX( A1 )
The SimulationMax function returns the maximum observed value of the reference cell, over all
iterations of the most recently run simulation.
Example: = SIMULATIONMEDIAN( A1 )
The SimulationMedian function returns the median value of the reference cell, over all iterations of the
most recently run simulation.
Example: = SIMULATIONMIN( A1 )
The SimulationMax function returns the minimum observed value of the reference cell, over all
iterations of the most recently run simulation.
Example: = SIMULATIONMODE( A1 )
The SimulationMedian function returns the mode (most commonly observed value) of the reference
cell, over all iterations of the most recently run simulation. This function does not return a true mode,
but a synthetic mode derived by placing results into "buckets" (much like creating a histogram).
The SimulationPercentile function returns the expected value of the reference cell corresponding to the
given percentile over all iterations of the simulation. A percentile value of 50% will return the mean
value of the reference cell; 0% will return the minimum value of the reference cell; and 100% will
return the maximum value of the reference cell.
This is one of the most useful functions in analyzing simulation data, but its use can be confusing at
first. An understanding of how this function works can be helpful in utilizing it in spreadsheet models.
In order to determine the value at a given probability, the function first sorts all observed values of the
reference cell over all iterations of the simulation in ascending order (low to high). It then returns the
value corresponding to the percentile – e.g., in a simulation of 100 iterations, the 90th percentile
corresponds to the 90th-highest value. Because the values have been sorted, we can say that in this
simulation, 90% of the observed values fall at or below the returned value (and correspondingly, 10%
of all values are at or higher than the returned value).
Normally-distributed values returned from a The same values sorted in ascending order, with the 90th
random function percentile value marked
In this manner the function can be used to describe confidence levels. In an investment return scenario,
for example, the 10th percentile can be used to determine the minimum expected return, in all but the
worst 10% of cases. This corresponds to a one-way confidence level1 of 90%; that is, we are 90%
confident that in a simulation, we will see a return equal to or better than the given value.
1 Two-way confidence levels are also commonly used to analyze data. A two-way confidence level is derived by taking
the values at the center, rather than one side of the data. For example, a two-way confidence level of 90% is determined
by finding the values at the 5th percentile and the 95th percentile. We know that 90% of the values lie between these two
points; therefore, the 5th and 95th percentiles represent the low and high values of a 90% two-way confidence interval.
Example: = SIMULATIONSKEWNESS( A1 )
The SimulationSkewness function returns the skewness of the reference cell over all iterations of the
most recently run simulation. Skewness refers to the degree of asymmetry of a distribution. The
normal distribution should be symmetric about the mean, with a skewness value of 0.
Example: = SIMULATIONSTANDARDDEVIATION( A1 )
The SimulationStandardDeviation function returns the standard deviation of the reference cell over all
iterations of the most recently run simulation.
Example: = SIMULATIONTRIALS( )
The SimulationTrials function returns the number of trials, or iterations, used in the most recently run
simulation. This function can be used as the base for custom analysis of data or reporting; it is often
used as the divisor in some analytic method.
The SimulationValue function returns the observed value of a particular cell at a given iteration (the
index) of the most recent simulation. For any cell in a spreadsheet, the value at each iteration can be
retrieved using this method.
Example: = SIMULATIONVARIANCE( A1 )
The SimulationVariance function returns the variance of the reference cell over all iterations of the
most recently run simulation.
This function is unique in that it returns an iteration index, rather than an observed or derived value.
The output of the function, an index, is intended for passing to the SimulationValue function (which
returns the value of a reference cell at a particular iteration of the simulation). This function can be
used to determine the value of an input cell at iterations of the simulation in which some other output
cell reached a particular value.
Generally speaking, continuous distributions return the probability that an event will occur or not
occur, based on input parameters particular to the distribution. The basic forms of most distributions
return probability values between 0 and 1, although many of the functions contained in the add-in
include parameters that affect the scale and offset of the returned values.
The continuous distribution functions contained in the add-in follow. See the description of the
distribution for more information on the add-in functions.
ArcSineValue LognormalValue
BetaValue NormalValue
CauchyValue ParabolicValue
ChiSquareValue ParetoValue
CosineValue Pearson5Value
DoubleLogValue Pearson6Value
ErlangValue PowerValue
ExponentialValue RayleighValue
FRatioValue StudentTValue
GammaValue TriangularValue
LaplaceValue UniformValue
LogarithmicValue WeibullValue
LogisticValue
Example: = ARCSINEVALUE( 0, 1 )
{ }
1
0 x1
Density: f x = x 1− x
0 otherwise
{ }
0 x0
2
sin x
−1
Distribution: F x = 0x1
1 x1
Example: = BETAVALUE( 1, 5 )
Density: f x =
{ x v−1 1−x w−1
Bv , w
0
0 x1
otherwise
} 1
where Bv , wis the beta function B v , w≡∫ t
v−1 w−1
1−t dt
0
Distribution: F x = { B x v , w/Bv , w
0
0x1
otherwise } x
where B x v , wis the incomplete beta function B x v , w ≡∫ t
v−1 w−1
1−t dt
0
Example: = CAUCHYVALUE( 0, 1 )
[ ]
2 −1
Density: 1 x −a
f x = 1 −∞x∞
b b
Distribution:
1 1
F x = tan−1
2
x −a
b
−∞ x∞
Example: = CHISQUAREVALUE( 1 )
Density: f x =
{ x v /2 −1 e− x/ 2
v/ 2
2 Γ v / 2
0
if x0
otherwise
} ∞
where Γ z is the gamma function Γ z ≡∫ t z −1 e−t dt
0
{ }
x
1
Distribution:
F x = v/ 2 ∫
2 Γ v /2 0
t v /2−1 e−t /2 dt if x0
0 otherwise
Example: = COSINEVALUE( 0, 1 )
Density: f x =
{ 1
2b
cos
0
x−a
b
x min xx max
otherwise
}
{ }
0 x x min
Distribution: F x = 1
2[ ]
1sin
x−a
b
x min xx max
1 x x max
Example: = DOUBLELOGVALUE( 0, 1 )
{ }
1 ∣x−a∣
− ln x min x x max
Density: f x = 2b b
0 otherwise
{ [ ]
}
1 ∣x −a∣ ∣x−a∣
− 1−ln x min xa
2 2b b
Distribution: F x =
2
1 ∣x −a∣
2b
1−ln[
∣x−a∣
b ] a xx max
Example: = ERLANGVALUE( 1, 2 )
Density: f x =
{ x /b c−1 e−x /b
bc−1!
0
x0
otherwise
}
{ }
c−1 i
x /b
1−e−x/ b ∑ x0
Distribution: F x = i =0 i!
0 otherwise
Example: = EXPONENTIALVALUE( 0, 1 )
{ }
1 − x−a / b
e x a
Density: f x = b
0 otherwise
Example: = EXTREMEVALUE( 0, 1 )
1
Density: f x = e x−a / b exp [−e x−a /b ] −∞x ∞
b
Example: = FRATIOVALUE( 4, 4 )
{ }
Γ [ vw / 2 ] v /wv /2 x v−2 / 2
x0
Density: f x = Γ v / 2Γ w/2 1 xv /w v w/ 2
0 otherwise
∞
where Γ z is the gamma function Γ z ≡∫ t
z −1 −t
e dt
0
Example: = GAMMAVALUE( 0, 1, 2 )
{ }
1 −c
b x−ac−1 e − x−a / b xa
Density: f x = Γ c
0 otherwise
∞
where Γ z is the gamma function Γ z ≡∫ t
z −1 −t
e dt
0
If n is an integer, Γ n= n−1!
{ }
c−1 k
1 x−a
1−e − x−a / b ∑ xa
F x = k=0 k! b
0 otherwise
Example: = LAPLACEVALUE( 0, 1 )
Density: f x =
1
2b
exp −
∣ x−a∣
b −∞x∞
{ }
1 x−a /b
e xa
2
Distribution: F x =
1
1− e− x−a /b xa
2
Example: = LOGARITHMICVALUE( 0, 1 )
Density: f x =
{ 1
− ln
b
0
x−a
b
x min x x max
otherwise
}
{ }
0 xx min
Distribution: F x =
[ ]
x−a
b
1−ln
x−a
b
x min x x max
1 xx max
Example: = LOGISTICVALUE( 0, 1 )
1 e x−a /b
Density: f x = −∞x∞
b [ 1e x−a /b ]2
1
Distribution: F x = − x− a /b
−∞x∞
1e
Example: = LOGNORMALVALUE( 0, 1, 0 )
Density: f x =
{ 1
2 x−a
exp
[
0
−[ ln x−a −2 ]
2 2 ] xa
otherwise
}
{{ [ ]} }
1 ln x−a−
1erf xa
Distribution: F x = 2 2
0 otherwise
Example: = NORMALVALUE( 0, 1 )
Density: f x =
1
2
exp
[− x−2
2 2 ]
Distribution: F x =
1
2[ ]
1erf
x−
2
Example: = PARABOLICVALUE( 0, 1 )
[ ]
2
3 x−a
Density: f x = 1− x min xx max
4b b
Example: = PARETOVALUE( 1 )
{ }
−c−1
x 1
Density: f x = cx
0 otherwise
{ }
−c
F x = 1− x x1
Distribution:
0 otherwise
Example: = PEARSON5VALUE( 1, 2 )
Density: f x =
{ x−c1 e−b / x
−c
b Γ c
0
if x0
otherwise
} ∞
where Γ z is the gamma function Γ z ≡∫ t z −1 e−t dt
0
{ }
Γ c , b / x
if x0
Distribution: F x = Γ c
0 otherwise
∞
where Γ a , z is the incomplete gamma function Γ a , z ≡∫ t
a −1 −t
e dt
z
Example: = PEARSON6VALUE( 1, 2, 4 )
{ }
x /bv−1
vw
if x0
Density: f x = b B v , w [ 1 x /b ]
0 otherwise
1
where Bv , wis the beta function B v , w≡∫ t
v−1 w−1
1−t dt
0
Distribution: F x =
{ FB
x
xb
0
if x0
otherwise
}
where F B x is the distribution function of a B v , w random variable
Example: = POWERVALUE( 1 )
Example: = RAYLEIGHVALUE( 0, 1 )
{ [ ] }
2 2
2 x−a x−a
exp − xa
Density: f x = x−a b b
0 otherwise
{ [ ] }
2
x−a
F x = 1−exp − xa
Distribution: b
0 otherwise
Example: = STUDENTTVALUE( 1 )
− v1 / 2
Γ [ v1/2 ] x2
Density: f x = 1 −∞x∞
v Γ v /2 v
∞
where Γ z is the gamma function Γ z ≡∫ t
z −1 −t
e dt
0
Example: = TRIANGULARVALUE( 0, 1, 2 )
{ }
2 x−x min
x min x c
x max −x min c− x min
Density: f x =
x x max −x
cx x max
x max −x min x max−c
{ }
x−x min 2
x min xc
x max −x min c−x min
Distribution: F x = 2
x max− x
1− cx x max
x max −x min x max−c
Example: = UNIFORMVALUE( 0, 1 )
{ }
1
x min x x max
Density: f x = x max −x min
0 otherwise
{ }
0 xx min
x− x min
Distribution: F x = x min x x max
x max −x min
1 x max x
Example: = WEIBULLVALUE( 0, 1, 2 )
{ [ ] }
c c
c x−a x−a
exp − xa
Density: f x = x−a b b
0 otherwise
{ [ ] }
c
x−a
F x = 1−exp − x a
Distribution: b
0 otherwise
Discrete distributions return some discrete value – true or false, 0 or 1, or some other specific values –
based on given probabilities and other inputs to the function.
The discrete distribution functions contained in the add-in follow. Refer to the description of each
distribution for more information on the add-in function and the returned value.
BernoulliValue
BinomialValue
GeometricValue
HypergeometricValue
NegativeBinomialValue
PascalValue
PoissonValue
Density: {
f k = 1− p
p
if
if
0
1 }
Distribution: {
F k = 1− p
p
if
if
0k 1
k1 }
{ nk p 1− p }
k n−k
k ∈ { 0,1,⋯, n }
Density: f k =
0 otherwise
{ }
k
Distribution: F k = ∑
i=0
ni p 1− p
i n−i
0k n
1 k n
where the binomial coefficient n =
i
n!
i!n−i!
Density: f k =
k n − k
K N −K
Nn
k k!n−k ! is the binomial coefficient
where n ≡
n!
{ }
sk −1! s
p 1− pk k ∈ {0,1,⋯, n }
Density: f k = k ! s−1!
0 otherwise
{ }
k
si−1! k
Distribution: F k = ∑ i! s−1!
p 1− pi x 0
i=0
0 otherwise
{ }
k −1!
p s 1− pk− s k ∈ { s , s1,⋯}
Density: f k = k −s! s−1!
0 otherwise
{ }
k
k −1!
Distribution: F k = ∑ i−s! s−1! p s 1− pi− s ks
i=1
0 otherwise
Example: = POISSONVALUE( 2 )
Density: f k =
{ k −
k!
0
e k ∈ { 0,1,⋯}
otherwise
}
{ }
k
i −
F k = ∑
e k 0
Distribution: i=0 i!
0 otherwise