monte.carlo.simulations {dse2}R Documentation

Generate simulations

Description

Run multiple simulations

Usage

    is.monte.carlo.simulation(obj)
    monte.carlo.simulations(model, simulation.args=NULL, 
           replications=100, rng=NULL, ...)
    monte.carlo.simulations(model, simulation.args = NULL, 
                replications = 100, rng = NULL, quiet = FALSE)
    monte.carlo.simulations(model, simulation.args=NULL,
          replications=100, rng=NULL, Spawn=.SPAWN, quiet=F)
    monte.carlo.simulations(model, simulation.args=NULL, 
           replications=100, rng=NULL, ...)
    monte.carlo.simulations(model,...)
    monte.carlo.simulations(model,...)

Arguments

model A model with a simulate method (e.g. a TSmodel).
simulation.args, A list of arguments in addition to model which are passed to simulate.
replications The number of simulations.
rng The RNG and starting seed.
Spawn If T "For" loops are used in Splus.

Details

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 estimation.evaluation 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.

Value

A list of simulations.

See Also

simulate eval.estimation distribution forecast.cov.wrt.true

Examples

if(is.R()) data("eg1.DSE.data.diff", package="dse1")
model <- est.VARX.ls(eg1.DSE.data.diff)
z <-  monte.carlo.simulations(model, simulation.args=list(sampleT=100))
tfplot(z)
distribution(z)