UniGASFor {GAS} | R Documentation |
Forecast with univariate GAS models
Description
Forecast with univariate GAS models. The one-step ahead prediction of the conditional density is available in closed form. The multi-step ahead prediction is performed by simulation as detailed in Blasques et al. (2016).
Usage
UniGASFor(uGASFit, H = NULL, Roll = FALSE, out = NULL, B = 10000,
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 |
|
Roll |
|
out |
|
B |
|
Bands |
|
ReturnDraws |
|
Value
An object of the class uGASFor.
Author(s)
Leopoldo Catania
References
Blasques F, Koopman SJ, Lasak K, and 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. doi: 10.1016/j.ijforecast.2016.04.002.
Examples
# Specify an univariate GAS model with Student-t
# conditional distribution and time-varying location, scale and shape parameter
# Inflation Forecast
set.seed(123)
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