simulate                package:dse1                R Documentation

_S_i_m_u_l_a_t_e _a _T_S_m_o_d_e_l

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

     Simulate a model to produce artificial data.

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

         simulate(model, ...)
         simulate(model, y0=NULL, input=NULL, input0=NULL,
             start. = NULL, freq = NULL, sampleT=100, noise=NULL, sd=1, SIGMA=NULL,
             rng=NULL, noise.model=NULL, compiled=.DSECOMPILED)
         simulate(model, input=NULL, 
             start. = NULL, freq = NULL,sampleT=100, noise=NULL, sd=1, SIGMA=NULL,
             rng=NULL, compiled=.DSECOMPILED)
         simulate(model, input=input.data(model),
                             sd=NULL, SIGMA=NULL, ...)

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

   model: An object of class TSmodel or TSestModel.

   input: Data for the exogenous variable if specified in the model.

 sampleT: The length of the sample to simulate.

  start.: start. date for resulting data.

    freq: freq for resulting data.

y0, input0: Lagged values prior to t=1 for y and u, in reverse order so
          y0[1,] and input0[1,]correspond to t=0. These arguments  are
          not implemented for state  space models. If not specified
          initial values are set to zero. 

   noise: Noise can be supplied. Otherwise it will be generated.  If
          supplied it should be a list as described below under
          returned value.

   SIGMA: The covariance of the noise process. If this is specified
          then sd is ignored. A vector or scalar is treated as a
          diagonal matrix. For an object of class TSestModel, if
          neither SIGMA nor sd are specified, then SIGMA is set to  the
          estimated covariance (`model$estimates$cov').

      sd: The standard deviation of the noise. This can be a vector.

noise.model: A TSmodel to be used for generating noise (not yet
          supported by SS methods).

     rng: The random number generator and seed can be specified to 
          regenerate a simulation.

    seed: The seed can be specified to regenerate a simulation.  (rng
          is better.)

compiled: Specifies the compiled version of the code should be used
          (instead of  the S code version).

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

     A state space or ARMA model as described in TSmodel is simulated
     with pseudo random noise (The default noise is a normally
     distributed processes.  An object of class TSdata is returned.
     This can be used as input to estimation algorithms. If start. and 
     freq are specified, or if input or `noise$w' (in that order) have
     time series properties, these are given to the output.  If
     `noise$w0' is a matrix (rather than a vector) for a state space
     model  simulation (as it is for ARMA simulations) then it is set
     to a vector of zeros. This provides compatability with VAR models
     (ARMA models with no lags in B). In general ARMA and SS
     simulations will not produce exactly the same results because it
     is impossible to determine necessary transformation of initial
     conditions and w0. The rng will be set first if it is specified.

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

     The value returned is an object of class TSdata which can be
     supplied as an argument to estimation routines. (See TSdata). In
     addition to the usual elements (see the description of a TSdata
     object)   there are some additional elements: model- the
     generating model,  rng - the initial RNG and seed, version - the
     version of S used (random number generators may vary) SIGMA as
     specified sd    as specified noise - a list of e, w and w0 - the
     noise processes. w0 is w for t=0 in the state space model and
     prior lags in ARMA models. For VAR models B has no lags so w0 has
     no effect. state - the state variable for state space models.

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

     `TSmodel', `TSdata'

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

     if(is.R()) data("eg1.DSE.data.diff", package="dse1")
     model <- est.VARX.ls(eg1.DSE.data.diff)
     z <- simulate(model)

