horizon.forecasts {dse2} | R Documentation |
Calculate forecasts at specified horizons.
is.horizon.forecasts(obj) horizon.forecasts(obj, ...) horizon.forecasts(obj, data, horizons=1:4, discard.before=minimum.startup.lag(obj), compiled=.DSECOMPILED) horizon.forecasts(obj, data=NULL, ...) horizon.forecasts(obj, model, ...)
obj |
An object of class TSmodel, TSdata, or TSestModel. |
model |
An object of class TSmodel. |
data |
An object of class TSdata |
horizons |
A vector of integers indicating the horizon at which forecasts should be produced. |
discard.before |
Period before which forecasts are not calculated. |
compiled |
If T compiled code is called. |
Calculate multiple 'horizon'-step ahead forecasts ie. calculate forecasts but return only those indicated by horizons. Thus, for example, the result of horizon.forecasts(model, data horizons=c(1,5)) would be the one-step ahead and five step ahead forecasts.
The result is a list of class horizon.forecasts with elements model (a
TSmodel), data, horizons, discard.before, and horizon.forecasts.
horizon.forecasts is an array with three dimension:
c(length(horizons), dim(model$data))
.
Projections are not calculated before discard.before or after
the end of output.data(data).
Each horizon is aligned so that horizon.forecasts[h,t,] contains the forecast
for the data point output.data(data)[t,] (from horizon[h] periods prior).
if(is.R()) data("eg1.DSE.data.diff", package="dse1") model <- est.VARX.ls(eg1.DSE.data.diff) z <- horizon.forecasts(model, eg1.DSE.data.diff)