mcr | R Documentation |
a wrapper for mc2d
mcr(myfilename = NULL, mycorrmatfilename = NULL, myseed = 12345L, nsims = 1000)
myfilename |
is the name of the main input Excel file |
mycorrmatfilename |
is the name of an input Excel file containing a desired correlation matrix (this is optional). |
myseed |
the random number seed to be used |
nsims |
the desired number of Monte Carlo simulations |
The input spreadsheet should have only one sheet with the following columns and one row for each variable to be simulated:
Index (numeric)
Variable (character)
codename (character)
Base (numeric)
Minimum (numeric)
Mode (numeric)
Maximum (numeric)
Distribution (character) - Uniform, Triangular, or PERT.
Shape (numeric) - only needed if distribution is "PERT"
If specified, the file "mycorrmatfilename" with the correlation matrix should have only one sheet and the variables should be named "V1", "V2", ..., "VN" for N variables.
myinputfile <- system.file("extdata", "risk_variable_distributions.xlsx", package = "humblr") mytest1 <- mcr(myinputfile, nsims = 1000, myseed = 12345L) mytest1 mycorrmatfile <- system.file("extdata", "correlation_matrix.xlsx", package = "humblr") mytest2 <- mcr(myinputfile, mycorrmatfilename = mycorrmatfile, nsims = 1000, myseed = 12345L) mytest2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.