Sei sulla pagina 1di 9

SIMTOOLS.

XLA can be downloaded from


http://www.kellogg.nwu.edu/faculty/myerson/ftp/addins.htm
It should be saved into your MSOffice\Excel\Library directory or MSOffice\Office
\Library directory (for Office97) or to the Excel MacroLibrary folder (in a Maci
ntosh). Then, in Excel, you can add Simtools by the Tools>Add-Ins command, check
ing the SimulationTools box.
Microsoft Excel provides two built-in functions that are of great importance in
simulation modeling: RAND and NORMINV.
Every RAND() that is used in a formula in an Excel workbook is takes a random va
lue that is drawn from a uniform distribution on the interval between 0 and 1, i
ndependently of all other RANDs in the workbook. New random values of the RANDs
are drawn every time the the spreadsheet is recalculated.
The NORMINV(probability,mean,standard_dev) function can be used to make random v
ariables that have a bell-shaped normal distribution, by putting a RAND() value
in the place of the first "probability" parameter. Such a normal random variabl
e has an approximately two-thirds probability of being between the values (mean-
standard_dev) and (mean+standard_dev). So for example, if we enter the formula
=NORMINV(RAND(),10,5) into any cell, then its value becomes a normal random vari
able with mean 10 and standard deviation 5, and it should be between 5 and 15 ab
out two-thirds of the time.
SIMTOOLS.XLA (version 3.3) adds 32 statistical functions to Excel.
Ten of these Simtools functions are (like NORMINV) used with the RAND() function
to make individual random variables that are drawn from other well-known famili
es of probability distributions: BETINV, BINOMINV, DISCRINV, EXPOINV, GAMINV, GE
NLINV, LNORMINV, POISINV, TRIANINV, and XTREMINV.
Six Simtools functions are used to work with correlations among random variables
: CORAND, MCORRELS, MIDRAND MSQRT (an advanced function included to help sophist
icated users compute correlated random variables like CORANDs faster), NORMIZE,
and PRODS.
Five Simtools functions are used for randomly generating discrete probability di
stributions: DIRICH, DIRALPHA, LGT, LGTINV, and SHUFFLE.
Six Simtools functions are designed to facilitate decision analysis in Excel: CE
, RISKTOL, UTIL, UINV, ARGMAX, and CEPR.
Three Simtools functions are designed for use in a basic probability classes to
analyze discrete random variables: STDEVPR, COVARPR, and CORRELPR.
Two Simtools functions are designed to extend the basic regression-analysis capa
bilities of Excel: REGRESSN and YHATSTE.
Short descriptions of these 32 Simtools functions, in alphabetical order, are as
follows:
ARGMAX(labels, values, testCells, criterion) returns a label from a cell in the
labels-range that corresponds to a maximal value cell, among all the cells in th
e values-range that correspond to test cells (if any) that match the criterion.
The labels-range and the values-range must have the same number of rows and the
same number of columns. The testCells and criterion are optional. If they are
included, then the testCells must be a range that has the same number of rows a
nd columns as the labels-range and values-range. Sophisticated criteria with "*
" as a wild card may be used, as in Excel's COUNTIF function.
BINOMINV(probability, n, p) returns the inverse cumulative distribution for a bi
nomial random variable. So the formula BINOMINV(RAND(),10,.7) yields a binomial
random variable with n=10 and p=.7.
The number of "successes" in n independent trials, when the probability of succe
ss is p in each trial, is a binomial random variable with parameters n and p. T
he mean of such a binomial random variable is n*p, and its standard deviation is
(n*p*(1-p))^.5.
BETINV(probability, mean, stdevn, lowerbound, upperbound) returns the inverse cu
mulative distribution for a Beta random variable on the interval from the lowerb
ound to the upperbound. This function differs from Excel's built-in BETAINV only
in that the parameters are the mean and the standard deviation, rather than the
mathematically traditional parameters "alpha" and "beta". If omitted, the defa
ult values for the lowerbound and upperbound are 0 and 1.
The value of a Beta random variable is always in the finite interval between its
lowerbound and its upper bound. Thus, the Beta distribution is often used to d
escribe beliefs about an unknown proportion, which must always be in the interva
l between 0 and 1 (that is, between 0% and 100%). For example the formula BETINV
(RAND(),.6,.1) yields a Beta random variable with mean 0.6 and standard deviatio
n 0.1, which always takes values between (the default bounds) 0 and 1.
CE(incomes, RiskTolConst, RiskTolSlope) returns the certainty equivalent of a ra
ndom draw from the incomes range, for a decision-maker with constant risk tolera
nce (or with linear risk tolerance when the optional RiskTolSlope parameter is u
sed). The incomes parameter must be a rectangular range. CE applies the UTIL f
unction (with the given risk-tolerance parameters) to each number in this income
s range, computes the average of these UTILity values, applies the UINV function
(with the same risk tolerance parameters) to this average utility, and returns
the resulting certainty equivalent. If the risk tolerance constant is 0 and the
RiskTolSlope parameter is omitted, then CE simply returns the average of the nu
mbers in the incomes range. Nonnumerical cells in the incomes range are ignored
. (If the RiskTolSlope parameter is used then a zero or negative risk tolerance
generates an error.)
CEPR(values, probabilities, RiskTolConst, testCells, criterion) returns the cert
ainty equivalent, for a decision-maker with constant risk tolerance, of a random
income drawn from the specified values according to the corresponding probabili
ties, conditional on the event where the corresponding test cells (if any) match
the criterion. When the RiskTolConst parameter is 0, the CEPR function returns
the conditional expected value. The values-range and the probabilities-range m
ust have the same number of rows and the same number of columns. The testCells
and criterion are optional. If included, the testCells range must have the same
number of rows and the same number of columns as the values and probabilities r
anges. Sophisticated criteria with "*" as a wild card may be used, as in Excel'
s COUNTIF function.
CORAND(correlarray, randsource) returns a vector of uniform 0-to-1 random variab
les (individually like RANDs) that are correlated appropriately to serve as seed
s for constructing random variables with the given correlations. CORAND is an a
rray function, designed to return values simultaneously to a selected range of c
ells in a row, when entered with CTRL-SHIFT-ENTER. (If you have never used an a
rray function, you should look at Excel's Help on "array formulas.")
For any whole number n greater than 1, the correlarray parameter may be a square
n-by-n array of correlations (as produced by MCORRELS), and then CORAND returns
n correspondingly correlated values. Such an n-by-n correlation array should be
symmetric and must have ones on the diagonal from top-left to bottom-right. (T
o handle a nonsymmetric array, CORAND only looks at the portion on and below the
diagonal.) The correlarray parameter can also be a single number, in which cas
e CORAND functions as if the correlarray parameter were a 2-by-2 array, returnin
g two random values with the given correlation.
For example, suppose that the value 1 is entered into cells A1 and B2, some valu
e between -1 and 1 is entered into cell B1, and the formula =B1 is entered into
the cell A2. Then suppose we select the selected range A4:B4 and we ctrl-shift-
enter the array formula =CORAND(A1:B2). The values of cells A4 and B4 will then
be random variables, each drawn from a uniform distribution on the interval fro
m 0 to 1, but correlated according to the value of cell B1. If the value in cel
l B1 is 0.95, for example, then the random values of cells A4 and B4 will tend t
o be close to each other. But if the value in cell B1 is -0.95, then the random
values of cells A4 and B4 will be negatively correlated and will tend to keep a
sum close to 1. Because CORAND is only generating two random values in this ca
se, the numerical correlarray syntax can also be equivalently used; that is, the
array formula =CORAND(B1) would be functionally equivalent to =CORAND(A1:B2) in
this example.
With an n-by-n correlation array, CORAND's optional randsource parameter can be
a reference either to a single cell or to n cells in a row, which should contain
independent RAND or CORAND values. When randsource is a single cell, this cell
's value is returned by CORAND as its last value on the right. When randsource i
s a range of n cells, CORAND looks in these cells for the random inputs that it
needs to generate its n correlated outputs, preserving the rightmost value. When
the optional randsource parameter is omitted, CORAND automatically generates it
s n random values by transforming the results of n implicit calls to Excel's ran
dom number generator.
Specifying a single-cell randsource range is useful for making autocorrelated se
ries. For example, suppose that cell A1 contains the value 0.8, cell B1 contain
s the formula =RAND(), and cell B2 contains the formula =CORAND($A$1,B1). Then
the value of cell B2 will contain a uniform 0-to-1 random variable that has a co
rrelation approximately 0.8 with the value of cell B1. Copying cell B2 down to
B3:B20 will then yield a series of 20 autocorrelated random variables, each havi
ng correlation approximately 0.8 with the value above it.
(Specifying a range of n cells as the randsource can be useful for making CORAND
work with uniform random inputs that are generated by another simulation add-in
for Excel.)
CORAND is designed so that, when the CORAND variables are used to construct norm
al random variables (through the NORMINV function), the probabilistic correlatio
ns among these normal random variables will match the numbers in the given array
. When CORANDs are used to make random variables with distributions other than
the normal, the resulting correlations may be slightly different. (In fact, COR
AND generates its random array by first creating an array of standard-normal ran
dom variables that have the given matrix of correlation coefficients, and then c
onverting these normal random variables to uniform random variables by the NORMS
DIST function.)
When the correlation array is large, the CORAND function can be quite slow, beca
use it recomputes a matrix square root every time it is called. If this is a pr
oblem, the MSQRT function (see below) can be used to generate the correlated ran
dom variables much more quickly, but using MSQRT requires a few more keystrokes
and a bit more thinking to set up the model.
CORRELPR(values1, values2, probabilities). For a probability distribution with
corresponding values of two random variables, CORRELPR returns the correlation c
oefficient of the random variables. The first two parameters (values1, values2)
are ranges which contain one cell for each possible combination of values of th
e two random variables, listing possible values of the first variable in the val
ues1 range and the second variable in the values2 range. The third parameter (p
robabilities) is a range containing the corresponding probabilities of these val
ue pairs. The cells in the probabilities range must contain nonnegative numbers
that sum to 1. The values1 and values2 ranges must each have the same number o
f rows and the same number of columns as the probabilities range.
COVARPR(values1, values2, probabilities). For a probability distribution with c
orresponding values of two random variables, COVARPR returns the covariance of t
he random variables. The first two parameters (values1, values2) are ranges whi
ch contain one cell for each possible combination of values of the two random va
riables, listing possible values of the first variable in the values1 range and
the second variable in the values2 range. The third parameter (probabilities) i
s a range containing the corresponding probabilities of these value pairs. The
cells in the probabilities range must contain nonnegative numbers that sum to 1.
The values1 and values2 ranges must each have the same number of rows and the
same number of columns as the probabilities range.
DIRALPHA(dataArray) is an array function. To a selected range that has one row
and the same number of columns as the data array, DIRALPHA returns estimated (ma
ximum-likelihood) alpha parameters for a Dirichlet distribution, under the assum
ption that each row of the data array is an independent sample from a fixed Diri
chlet distribution. Each row of the data array must contain nonnegative numbers
that sum to one.
DIRICH(alphaArray, randsource) is an array function. To a selected range that h
as the same numbers of rows and columns as the alpha array, DIRICH returns Diric
hlet random fractions that are nonnegative and have a sum equal to 1. The means
of these random fractions are proportional to the values in the alpha array. H
igher alpha-array values yield lower variance. The values in the alpha array sh
ould be positive numbers, usually greater than 1.
Random seeds for these Dirichlet fractions may be provided externally by RAND or
CORAND formulas in a range specified by the optional randsource parameter. If
included, this randsource must be a range that has the same numbers of rows and
columns as the alpha array, and it must contain random numbers between 0 and 1
that are generated by independent RAND or CORAND formulas. With CORAND formulas
, this optional randsource could be used to correlate the corresponding DIRICH f
ractions with other random variables in the spreadsheet. If the randsource para
meter is omitted, then DIRICH generates its own random numbers.
To describe the statistical properties of Dirichlet random fractions more precis
ely, let a(i) denote the value of the i'th cell in the alpha array, and let A de
note the sum of all the cells in the alpha array. Then the i'th cell in the DIR
ICH array function has a random value with mean a(i)/A and with standard deviati
on (a(i)*(A-a(i))/(A*A*(A+1)))^0.5.
For example, suppose that the values of cells A1, B1, and C1 are 20, 30, and 50
respectively, and suppose that the array formula =DIRICH(A1:C1) is ctrl-shift-en
tered into the selected range A3:B3. Then cell A3 has a random value with mean
0.2 and standard deviation 0.0398, cell B3 has a random value with mean 0.3 and
standard deviation 0.0456, and cell C3 has a random value with mean 0.5 and stan
dard deviation 0.0498. These Dirichlet random values in the range A3:C3 will al
ways be nonnegative, and their sum will always equal 1
If we have several types of potential customers, Dirichlet random variables can
be used to describe our uncertainty about what fractions of our customers will b
e of each type. If our beliefs about these unknown fractions are derived from d
ata about the types that were observed in a sample of past customers then, in th
e alpha array, the value of the alpha cell that corresponds to each type of cust
omer should be one more than the number of customers of this type that were obse
rved in the sample.
DISCRINV(randprob, values, probabilities). When the first parameter (randprob)
is set equal to RAND(), then DISCRINV returns a discrete random variable with va
lues and corresponding probabilities in the given ranges.
EXPOINV(probability, mean) returns the inverse cumulative distribution for an ex
ponential distribution. So =EXPOINV(RAND(),10) is an exponential random variabl
e with mean 10. The exponential distribution is often used to describe waiting
times, such as the unknown time that we will have to wait until the next custome
r arrives into a shop.
The standard deviation of an exponential random variable is the same as its mean
. The exponential random variables are actually a subset of the more general ga
mma family of random variables.
GAMINV(probability, mean, stdevn) returns the inverse cumulative distribution fo
r a gamma random variable. So =GAMINV(RAND(),10,5) is a gamma random variable w
ith mean 10 and standard deviation 5. This GAMINV function differs from Excel's
built-in GAMMAINV function only in that GAMINV is parameterized by the mean and
standard deviation, rather than the mathematically traditional parameters "alph
a" and "beta," which are harder to intuitively assess.
The value of a gamma random variable can be any nonnegative number. Gamma rando
m variables are sometimes used to describe our uncertainty about the length of t
ime that some project will take. Gamma distributions are also used to describe
our beliefs about the unknown mean of a Poisson random variable (For example, if
we are learning about the rate at which accidents are likely to occur in a new
factory, our uncertainty about the long-run rate of accidents might be described
by a gamma distribution.)
GENLINV(probability, quartile1, quartile2, quartile3, lowest, highest) returns t
he inverse cumulative distribution for a "generalized lognormal" random variable
that has 25% probability below quartile1, 50% probability below quartile2, and
75% probability below quartile3. (A generalized lognormal random variable is a
constant plus or minus a lognormal random variable.) So if a manager has assess
ed that his new product's first-year sales are equally likely to be above or bel
ow 3000 units, and have a probability 1/4 of being below 1000, and a probability
1/4 of being above 7000, then GENLINV(RAND(),1000,3000,7000) is a random variab
le that fits the manager's assessed quartiles. Thus, the GENLINV function is u
seful for simulating random variables for which a decision-maker has subjectivel
y assessed quartile boundary points.
In the case where quartile3-quartile2 = quartile2-quartile1, the generalized log
normal becomes simply a normal random variable, with mean equal to quartile2 and
with standard deviation equal to (quartile3-quartile2)/0.675. So GENLINV(RAND(
),1000,4000,7000) is a normal random variable with mean 4000 and standard deviat
ion 3000/0.675 = 4444.
In the case where quartile3/quartile2 = quartile2/quartile1, the generalized log
normal becomes simply a lognormal random variable (but its mean and standard dev
iation are not so simple to compute).
The lowest and highest parameters are optional. If they are included, then valu
es of GENLINV are adjusted as necessary to stay within these bounds. So the for
mula
GENLINV(RAND(),quartile1,quartile2,quartile3,lowest,highest)
is equivalent to the formula
MIN(highest,MAX(lowest,GENLINV(RAND(),quartile1,quartile2,quartile3)))
when the parameters satisfy the required inequalities
lowest <= quartile1 < quartile2 < quartile3 <= highest.
So to take account of the impossibility of negative sales, with the assessed qua
rtile points 1000, 3000, and 7000, we can use the formula GENLINV(RAND(),1000,30
00,7000,0), which is never negative (but may equal 0, with a probability close t
o 9%).
If capacity constraints imply that sales also could never be higher than 20000,
then we could use the formula GENLINV(RAND(),1000,3000,7000,0,20000) to simulate
first-year sales.
LGT(X) transforms random variables from a logit model to fractions between 0 and
1 or (as an array function) to discrete probability distributions proportional
to EXP(x(i)). The parameter X may be a number, or a range of cells in a row. W
hen X is a number or a single cell, LGT returns the value EXP(X)/(EXP(X)+1). Whe
n X is a range of n cells in a row, where n>=2, LGT returns an array of fraction
s that sum to 1, where the i'th fraction is EXP(X(i)) divided by the sum of all
EXP(X(j)) for j=1 to n. (In a logit model, the last cell in the X range should
equal 0 and the other cells in the X range should be multivariate normal random
variables.)
LGTINV(P) is the inverse of the logistic or logit function LGT. The parameter P
may be a single number or a range of cells in a row. When P is a number or a si
ngle cell, LGTINV returns the value LN(P/(1-P)). When P is a range of n cells,
where n>=2, LGTINV returns an array of log-odds ratios, where the i'th value is
LN(P(i)/P(n)). (So the last value in aLGTINV array should equal 0.) When P con
tains distributional data, statisticians commonly assume that LGTINV(P) is a mul
tivariate normal random vector.
LNORMINV(probability, mean, stdevn) returns the inverse cumulative distribution
for a lognormal random variable, parameterized by its mean and standard deviatio
n. So the formula =LNORMINV(RAND(),10,5) generates a lognormal random variable
that has mean 10 and standard deviation 5. Excel's LOGINV function might seem t
o do the same thing, but the "mean" and "standard deviation" parameters of LOGIN
V are actually the mean and standard deviations of the logarithm of the random v
ariable that is generated by the function, not the random variable itself.
The value of a lognormal random variable can be any nonnegative number. The pro
duct of two independent lognormal random variables is also lognormal. Because o
f this multiplicative property, lognormal random variables are often used to mod
el the growth of demand for a product over some period of time, or the appreciat
ion of a financial asset over some period of time.
MCORRELS(dataRange) returns the matrix of correlation coefficients among the col
umns of the data range. MCORRELS is array function returning values to a square
range in which the numbers of rows and the columns must be equal to the number o
f columns in the data range. The output of MCORRELS can be used as the correlat
ion-array parameter of the CORAND function.
MIDRAND(correlation, givenCoValue) returns the conditional median of a CORAND gi
ven the value of another CORAND and their correlation. Used for subjective asse
ssment of correlations.
MSQRT(squareArray) returns a lower-triangular matrix square root of a given squa
re array. The formula =MSQRT(array) returns a matrix that has the same number o
f rows and columns as the given array. MSQRT is an array function, designed to
return values to a selected range all at once (when entered with CTRL+SHIFT+ENTE
R). (If you have never used an array function, you should look at Excel's Help
on "array formulas.") In Excel's array-formula notation, MSQRT is designed to s
atisfy the mathematical equation
MMULT(TRANSPOSE(MSQRT(squareArray)),MSQRT(squareArray)) = (squareArray)
when the given square array is symmetric. (To handle a nonsymmetric array, MSQR
T only looks at the portion on and below the diagonal.)
This MSQRT function can be used to build a row of normal random variables that h
ave covariances and variances as in the given array. To do so, make a column-ar
ray of standard normal random variables (with NORMINV(RAND(),0,1) in each cell)
and take the SUMPRODUCT of this column-array with each of the columns in the MSQ
RT(array) output. These sumproducts will jointly have a multivariate normal pro
bability distribution, with mean 0 and covariances as in the given array.
NORMIZE(datacolumn) returns values (fractile medians) from a standard normal dis
tribution with the same rank-order as the data column. An array function. When
CORANDs are used to make continuous random variables that are not Normal, the co
rrelation parameters of CORAND should be normalized rank correlations, which can
be estimated from data by applying NORMIZE to each data series and then computi
ng the correlations among these normalized arrays. (Having large array formulas
can make a spreadsheet recalculate slowly. To avoid this problem, a range of N
ORMIZEd data can be copied and pasted-special values onto itself.)
POISINV(probability, mean) returns the inverse cumulative distribution for a Poi
sson random variable. So =POISINV(RAND(),10) is a Poisson random variable with
mean equal to 10.
The value of a Poisson random variable is always an nonnegative integer, but it
can be arbitrarily large (unlike the binomial random variable which cannot be la
rger than its parameter n). Thus, Poisson random variables are often used for
the unknown number of customers who will come into a shop during a fixed time in
terval, or the number of accidents that will occur in a factory during some fixe
d time interval.
PRODS(values) multiplies each pair of values in the given range and returns the
products as a square array. The values must be given in one row or one column. T
o illustrate the use of this function, suppose that a range named "correls" list
s the correlations of the random returns per share of various stocks, a range na
med "stdevns" lists the standard deviations of these stock returns, and a range
named "shares" lists the numbers of shares of these stocks in some investment po
rtfolio; then the standard deviation of the total returns of the portfolio is S
UMPRODUCT(PRODS(shares),PRODS(stdevns),correls)^0.5
RISKTOL(HighIncome, LowIncome, CertainEquiv) returns the constant risk tolerance
such that a lottery paying either the high or low income, each with probability
1/2, has this certainty equivalent value. The parameters must be numbers satis
fying the inequalities
HighIncome > CertainEquive > LowIncome.
(RISKTOL returns a #DIV/0! error when the CertainEquiv is exactly halfway betwee
n the HighIncome and the LowIncome, because this is the case of risk neutrality,
which corresponds to infinite risk tolerance, and the AVERAGE function should b
e used instead of the CE function in this case.)
REGRESSN(XDataRange, YDataRange) returns multiple regression output to a selecte
d range, which must have 7 rows and as many columns as the XDataRange. This is
an array function, and must be entered with the keystrokes CTRL+SHIFT+Enter. Th
e XDataRange must be a rectangular range of cells, and the number of rows in thi
s range must be at least two more than the number of columns. The YDataRange mu
st be a range of cells in one column with as many rows as the X data range. The
advantage of using REGRESSN instead of Excel's DataAnalysis regression package
is that the output of REGRESSN actively changes whenever the data changes. (See
also YHATSTE.)
SHUFFLE(n, RandSource), entered as an array formula in a range of n cells in one
row, returns a random ordering of the numbers from 1 to n. When entered into a
row range of fewer than n cells, this function generates random samples from {1
,...,n} without replacement.
For small n (n<8), a list of all permutations of {1,...,n} can be generated by l
etting the optional RandSource parameter range from 0 to (n!-1)/n! in steps of s
ize 1/n!. (The quantity n! is FACT(n) in Excel.)
Given a range of n cells in a row, the array formula {=INDEX(range,1,SHUFFLE(n))
}, entered into another n cells in a row, shuffles the values of the given range
.
STDEVPR(values, probabilities). For a probability distribution with correspondi
ng values of a random variable, STDEVPR returns the standard deviation of the ra
ndom variable. The first parameter (values) is a range that contains one cell f
or each possible value of the random variable. The second parameter (probabilit
ies) is a range that contains the respective probabilities of these values. The
cells in the probabilities range must contain nonnegative numbers that sum to 1
. The values range must have the same number of rows and the same number of col
umns as the probabilities range.
TRIANINV(probability,lowerbound,mostlikely,upperbound) returns the inverse cumul
ative for a triangular probability density on the interval from the lowerbound t
o the upperbound, with mode at the mostlikely value. So =TRIANINV(RAND(),5,10,2
0) yields a random variable that takes values between 5 and 20, with a probabili
ty density that is highest at 10.
UINV(utility, RiskTolConst, RiskTolSlope) returns the monetary certainty equival
ent that corresponds to an expected utility value computed with the UTIL functio
n using the same risk-tolerance parameters. If omitted, the RiskTolSlope parame
ter is assumed to be zero (constant risk tolerance).
UTIL(income, RiskTolConst, RiskTolSlope) returns the utility value of monetary i
ncome, for a decision maker with constant or linear risk tolerance. When the Ri
skTolSlope parameter is omitted or set equal to zero, then the formula used is
UTIL(income,RiskTolConst) = -EXP(-income/RiskTolConst)
When the risk-tolerance-slope parameter equals 1, then the formula is
UTIL(income,RiskTolConst,1) = LN(RiskTolConst+income)
When the RiskTolSlope parameter is neither zero nor one then the formula is
UTIL(income,RiskTolConst,RiskTolSlope) = ((RiskTolConst+RiskTolSlope*income)^(1-
1/RiskTolSlope))/(RiskTolSlope-1)
XTREMINV(probability, mean, stdevn) returns inverse cumulative values for an ext
reme-value (or Gumbel) random variable, parameterized by its mean and standard d
eviation. When the first parameter is a RAND, XTREMINV yields a random variable
that may be positive or negative.
If W is a Weibull random variable then -LN(W) has this extreme-value distributio
n.
As conventionally defined, the extreme-value distribution is positively skewed,
with a longer tail in the positive direction. But negative value of the stdevn
parameter can be used in XTREMINV to yield a negatively-skewed random variable t
hat has a distribution which is the mirror image of a conventional extreme-value
distribution. The standard deviation for such a random variable would then be
the absolute value of the stdevn parameter.
YHATSTE(XDataRange, NewXRow, RegressnStdErr) returns the standard error of the e
stimated conditional mean of Y (often called Y-hat) at the given new X row, for
a multiple regression with the X data range and the regression standard error as
specified in the parameters of YHATSTE. The XDataRange must be a rectangular r
ange of cells. The new X row must be a range of cells in one row with as many c
olumns as the X data range. The regression standard error is a number (specifie
d by REGRESSN or by Excel in its regression output).
(Function names that have changed in version 2 of Simtools:
The version-1 functions BINV, GINV, TRNGLINV, and EXPLINV have been renamed BETI
NV, GAMINV, TRIANINV, and EXPOINV. The version-1 function EXPLUTIL function has
been replaced by a new function UTIL which has better computational properties.
The inverse of the UTIL function is UINV.)

SIMTOOLS.XLA also adds three macro procedures to the Excel Tools menu:
SIMULATION TABLE tabulates output from repeated MonteCarlo simulations of a spre
adsheet model with random variables. To use SimulationTable, Excel's Calculatio
n property must be set to Automatic (see Tools>Options>Calculation). Before usi
ng the SimulationTable macro, a range must be selected in which the output to be
tabulated is in the top row, but not in the top-left cell. The output from repe
ated recalculations of the model then fills the lower rows of the selected range
below these output cells. The leftmost column of the selected range is filled
with fractile numbers, indicating (in each row of the simulation table) what fra
ction of the simulation data is above this row. SimulationTable is similar to a
column-input DataTable, but SimulationTable stores the output data as values th
at are not recalculated whenever the spreadsheet changes.
ITERATIVE PROCESS iteratively updates a State Range with values copied from an U
pdate Range, while tabulating output into an Output Table. The State Range and
the Update Range must have the same size. The Output Table must have outputs fr
om the model in the top row, but leaving the top-left cell unused; iteration num
bers will fill the left column. During iteration, Excel's Calculation option wi
ll be temporarily set to Manual, and then will be reset to Automatic when the si
mulation is done.
COMBINE ROWS combines copies of the rows in selected input ranges, to make an ou
tput range whose rows are all the possible combinations of the rows in the input
ranges. Using CombineRows (and the LOOKUP or VLOOKUP function), a column-input
data table can be made to show functional dependence on any number of variables
. CombineRows can also be useful in making tables to calculate conditional prob
abilities.

In addition to the functions that are added by Simtools, the following regular E
xcel functions should be noted for their importance in making simulation models
and for doing statistical analysis: RAND, NORMINV, BETAINV, GAMMAINV, CHIINV, LO
GINV, NORMSDIST, TDIST, TINV, FINV, FDIST, LOOKUP, VLOOKUP, INDEX, EXP, LN, SUM,
SUMPRODUCT, IF, AND, OR, SUMIF, COUNTIF, INT, MAX, MIN, AVERAGE, STDEV, STDEVP
, FREQUENCY, QUARTILE, PERCENTILE, VAR, COVAR, CORREL, DCOUNT, DSUM, DAVERAGE,
OFFSET, INDIRECT, TRANSPOSE, NPV.
Anyone who does advanced modeling in Excel should also become familiar with the
column-input DataTable procedure, the DataSort procedure, the Solver procedure,
and Chart making. From more basic courses, students should be familiar with the
Cut, Copy, Paste, and PasteSpecial>Values commands, and the use of absolute($)
references.
I also recommend using my FORMLIST.XLA add-in (also available from http://www.ke
llogg.nwu.edu/faculty/myerson/ftp/addins.htm) to display the hidden formulas tha
t are used in any analytical spreadsheet. Formlist adds one macro procedure to
the Excel Tools menu, and it adds one Lookup&Reference function called FORMULAS.

Potrebbero piacerti anche