forecastCov               package:dse2               R Documentation

_F_o_r_e_c_a_s_t _c_o_v_a_r_i_a_n_c_e _f_o_r _d_i_f_f_e_r_e_n_t _m_o_d_e_l_s

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

     Calculate the forecast covariance for different models.

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

         is.forecastCov(obj)
         forecastCov(obj, ..., data=NULL, horizons=1:12, discard.before=NULL,
            zero=FALSE, trend=FALSE, estimation.sample= NULL, compiled=.DSECOMPILED)
         ## S3 method for class 'TSmodel':
         forecastCov(obj, ..., data=NULL,
            horizons=1:12, discard.before=NULL, 
            zero=FALSE, trend=FALSE, estimation.sample= periods(data), compiled=.DSECOMPILED)
         ## S3 method for class 'TSestModel':
         forecastCov(obj, ..., data=TSdata(obj), 
            horizons=1:12, discard.before=NULL, zero=FALSE, trend=FALSE, 
            estimation.sample= periods(TSdata(obj)), compiled=.DSECOMPILED)
         ## S3 method for class 'TSdata':
         forecastCov(obj, ..., data=NULL,
            horizons=1:12, discard.before=1,
            zero=FALSE, trend=FALSE, estimation.sample= NULL,
             compiled=.DSECOMPILED)

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

     obj: TSdata or one or more TSmodels or TSestModels

    data: an object of class TSdata.

discard.before: period before which forecasts should be discarded when
          calculating covariance.

horizons: horizons for which forecast covariance should be calculated.

    zero: if TRUE the covariance is calculated for a forecast of zero.

   trend: if TRUE the covariance is calculated for a forecast of trend.

estimation.sample: portion of the sample to use for calculating the
          trend.

compiled: a logical indicating if compiled code should be used.
          (Usually true except for debugging.)

     ...: arguments passed to other methods.

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

     Calculate the forecast cov of obj relative to data. If obj is
     TSdata then the output data is used as the forecast. For other
     classes of obj TSmodel(obj) is used with data to produce a
     forecast. TSmodel() is also applied to each element of ... to
     extract a model. All models should work with data. If obj is a
     TSestModel and data is NULL then TSdata(obj) is used as the data.
     This is multiple applications of forecastCovSingle.TSmodel
     discard.before is an integer indicating the number of points in
     the beginning of forecasts to discard before calculating
     covariances. If it is the default, NULL, then the default
     (minimumStartupLag) will be used for each model and the default
     (1) will be used for trend and zero. If zero  is TRUE then
     forecastCov is also calculated for a forecast of zero. If trend is
     TRUE then forecastCov is also calculated for a forecast of a
     linear  trend using data to estimation.sample.

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

     A list with the forecast covariance for supplied models on the
     given sample. This is in the element 'forecastCov' of the result.
     Other elements contain information in the arguments.

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

         if(is.R()) data("eg1.DSE.data.diff", package="dse1")
         model1 <- estVARXar(eg1.DSE.data.diff)
         model2 <- estVARXls(eg1.DSE.data.diff)
         z <-  forecastCov(model1, model2, data=trimNA(eg1.DSE.data.diff))
         is.forecastCov(z)

