Description Usage Arguments Details Value
Run a Monte Carlo simulation for a scenario given fixed distributions for one or more of the simulation parameters. At each iteration all of the parameters for which distributions were supplied will have values selected from their distributions, while other parameters will be held at the base values supplied.
1 2 3 4 5 6 7 8 |
N |
number of MC iterations to run |
distparms |
Parameter distributions. See details for how to specify a distribution. |
tmax |
End time for simulations |
baseparms |
Base parameters. Any parameters without distributions will be set to the values specified here (or to their default values, if unspecified.) |
rawsims |
Flag indicating whether to return the raw simulation output, or a summarized version. |
The distparams input should be a named list of functions that return samples
from the indicated variables. For example, if we wanted to have hospFrac
distributed as Beta(4, 98) and T0
distributed as Gamma(20, 4), we would
write:
1 2 3 |
Helper functions such as genbeta
provide an easy way to generate
functions for common distributions. Using the helper functions you would write
these distributions as:
1 2 3 |
A list of data frames, one for each of the forecast variables returned by
run_scenario. The form of the outputs depends on the setting
of the
rawsims
input. If rawsims
is FALSE
, then we get back
a data frame with ensemble mean, median, standard deviation, 5th, and 95th percentiles,
reported by time.
If rawsims
is TRUE
, then each output is a data frame with the output
variable reported by time and MC iteration.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.