Learn R Programming

GAS (version 0.1.1)

UniGASFor: Forecast with univariate GAS models

Description

Forecast with univariate GAS models. One step ahead prediction of the conditional density is available in closed form. Multistep ahead prediction are performed by simulation as detailed in Blasques et al. (2016).

Usage

UniGASFor(uGASFit, H, Roll = F, out = NULL,B = 1000, Bands = c(0.1,0.15,0.85,0.9), ReturnDraws = FALSE)

Arguments

uGASFit
An object of the class uGASFit created using the function UniGASFit
H
numeric Forecast horizon. Ignored if Roll = TRUE
Roll
boolean Forecast should be made using a rolling procedure ? Note that if Roll = TRUE, then vOut has to be specified.
out
numeric Vector of out of sample observation for rolling forecast
B
numeric Number of draws from the H-step ahead distribution if Roll = TRUE.
Bands
numeric Vector of probabilities representing the confidence band levels for multistep ahead parameters forecasts. Only if Roll = TRUE.
ReturnDraws
boolean Return the draws from the multistep ahead predictive distribution when Roll = TRUE ?

Value

An object of the class uGASFor

References

Blasques, F., Koopman, S. J., Lasak, K., & Lucas, A. (2016). In-sample confidence bands and out-of-sample forecast bands for time-varying parameters in observation-driven models. International Journal of Forecasting, 32(3), 875-887.

Examples

Run this code
# Specify an univariate GAS model with Student-t
# conditional distribution and time-varying location, scale and shape parameter

# Inflation Forecast

data("cpichg")

GASSpec   = UniGASSpec(Dist = "std", ScalingType = "Identity",
                       GASPar = list(location = TRUE, scale = TRUE, shape = FALSE))

# Perform H-step ahead forecast with confidence bands

Fit       = UniGASFit(GASSpec,cpichg)
Forecast  = UniGASFor(Fit, H = 12)

Forecast

# Perform 1-Step ahead rolling forecast

InsampleData  = cpichg[1:250]
OutSampleData = cpichg[251:276]

Fit           = UniGASFit(GASSpec, InsampleData)

Forecast  = UniGASFor(Fit, Roll = TRUE, out = OutSampleData)

Forecast

Run the code above in your browser using DataLab