Run multiple simulations
is.MonteCarloSimulations(obj)
MonteCarloSimulations(model, simulation.args=NULL,
replications=100, rng=NULL, quiet =FALSE, ...)
# S3 method for default
MonteCarloSimulations(model, simulation.args = NULL,
replications = 100, rng = NULL, quiet =FALSE, ...)
# S3 method for TSmodel
MonteCarloSimulations(model, simulation.args=NULL,
replications=100, rng=NULL, quiet=FALSE, ...)
# S3 method for TSestModel
MonteCarloSimulations(model, simulation.args=NULL,
replications=100, rng=NULL, quiet=FALSE, ...)
# S3 method for EstEval
MonteCarloSimulations(model, simulation.args=NULL,
replications=100, rng=getRNG(model), quiet=FALSE, ...)
# S3 method for MonteCarloSimulations
MonteCarloSimulations(model,
simulation.args=NULL, replications=100, rng=getRNG(model), quiet=FALSE, ...)
A list of simulations.
an object from which a model can be extracted. The model must
have an associated simulation
method (e.g. a TSmodel).
A list of arguments in addition to model which are passed to simulate.
The number of simulations.
The RNG and starting seed.
logical indicating if printing and many warning messages should be suppressed.
an object.
arguments passed to other methods.
This function runs many simulations using simulate
.
Often it not be necessary to do this since the seed can be used to
reproduce the sample and many functions for testing estimation methods, etc.,
will produce samples as they proceed. This function is useful for verification
and for looking at the stochastic properties of the output of a model.
If model
is an object of class EstEval
or
simulation
then the model and the seed!!! are extracted so the same sample will be
generated. The default method expects the result of simulate(model)
to be
a matrix.
There is a tfplot
method (time series plots of the simulations) and a
distribution
method for the result. The latter plots kernel estimates
of the distribution of the simulations at specified periods.
simulate
EstEval
distribution
forecastCovWRTtrue
data("eg1.DSE.data.diff", package="dse")
model <- estVARXls(eg1.DSE.data.diff)
z <- MonteCarloSimulations(model, simulation.args=list(sampleT=100))
tfplot(z)
distribution(z)
Run the code above in your browser using DataLab