MonteCarloSimulations          package:dse2          R Documentation

_G_e_n_e_r_a_t_e _s_i_m_u_l_a_t_i_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     Run multiple simulations

_U_s_a_g_e:

         is.MonteCarloSimulations(obj)
         MonteCarloSimulations(model, simulation.args=NULL, 
                replications=100, rng=NULL, quiet =FALSE, ...)
         ## Default S3 method:
         MonteCarloSimulations(model, simulation.args = NULL, 
                     replications = 100, rng = NULL, quiet =FALSE, ...)
         ## S3 method for class 'TSmodel':
         MonteCarloSimulations(model, simulation.args=NULL,
               replications=100, rng=NULL, quiet=FALSE, 
               Spawn=if (exists(".SPAWN")) .SPAWN else FALSE, ...)
         ## S3 method for class 'TSestModel':
         MonteCarloSimulations(model, simulation.args=NULL, 
                replications=100, rng=NULL, quiet=FALSE, ...)
         ## S3 method for class 'EstEval':
         MonteCarloSimulations(model, simulation.args=NULL,
                 replications=100, rng=getRNG(model),  quiet=FALSE, ...)
         ## S3 method for class 'MonteCarloSimulations':
         MonteCarloSimulations(model, 
            simulation.args=NULL, replications=100, rng=getRNG(model),  quiet=FALSE, ...)

_A_r_g_u_m_e_n_t_s:

   model: an object from which a model can be extracted. The model must
          have an associated 'simulation' 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.

   quiet: logical indicating if printing and many warning messages
          should be suppressed.

   Spawn: If TRUE "For" loops are used in Splus.

     obj: an object.

     ...: arguments passed to other methods.

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

     A list of simulations.

_S_e_e _A_l_s_o:

     'simulate' 'EstEval' 'distribution' 'forecastCovWRTtrue'

_E_x_a_m_p_l_e_s:

     if(is.R()) data("eg1.DSE.data.diff", package="dse1")
     model <- estVARXls(eg1.DSE.data.diff)
     z <-  MonteCarloSimulations(model, simulation.args=list(sampleT=100))
     tfplot(z)
     distribution(z)

