View source: R/mvar.forecast.r
mvar.forecast | R Documentation |
Background: A multivariate difference-stationary process x_t with w_t = delta(B) x_t may be observed with missing values, and one wants to compute Gaussian conditional expectations of missing values (midcasts), or future values (forecasts), or past values (aftcasts). Also of interest is the Gaussian likelihood resulting from such a sample, and the residuals.
mvar.forecast(x.acf, z, needMSE)
x.acf |
Array of dimension N x T x N of autocovariances for process w_t, where there are N series, of total length T each. |
z |
Differenced data as N x (T+H) matrix, with missing values at various time points. Presumes first T observations are not missing, and latter H observations are missing, being encoded with 1i in that entry. That is, Im(z[,t]) = rep(1i,N) encodes missing values. |
needMSE |
A binary flag, with 1 indicating that forecast MSE should be computed; else with a 0 this will be skipped (runs faster in this mode). |
Notes: running this code with needMSE=1 makes it slower, but yields pred.stack, however the routine mvar.midcast is preferred for obtaining any casts with uncertainty. I think the pred.stack feature here should be deprecated, but not sure if I want to completely remove it in case another application comes up.
list containing preds.x and pred.stack preds.x: N x (T+H) matrix of data with forecasts, where H is the total number of time indices with missing values. pred.stack: NT x H matrix of predictors, which can be used to obtain uncertainty.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.