horizon.forecasts
Calculate forecasts at specified horizons
Description
Calculate forecasts at specified horizons.
Usage
horizon.forecasts(model, data, horizons=1:4, discard.before=minimum.startup.lag(model), fortran=T)
Required Arguments
- model
-
An object of class TSmodel.
- data
-
An object of class TSdata
Optional Arguments
- horizons
-
A vector of integers indicating the horizon at which forecasts should be produced.
- discard.before
-
Period before which forecasts are not calculated.
- fortran
-
If T fortran code is called.
Value
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).
Details
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.
See Also
Examples
z <- horizon.forecasts(model, data)
return to Table of Contents