if (FALSE) {
# Specify a GAS model with multivatiate Student-t conditional
# distribution and time-varying scales and correlations.
# Stock returns forecast
set.seed(123)
data("StockIndices")
mY = StockIndices[, 1:2]
# Specification mvt
GASSpec = MultiGASSpec(Dist = "mvt", ScalingType = "Identity",
GASPar = list(location = FALSE, scale = TRUE,
correlation = TRUE, shape = FALSE))
# Perform H-step ahead forecast with confidence bands
# Estimation
Fit = MultiGASFit(GASSpec, mY)
# Forecast
Forecast = MultiGASFor(Fit, H = 50)
Forecast
# Perform 1-Step ahead rolling forecast
InSampleData = mY[1:1000, ]
OutSampleData = mY[1001:2404, ]
# Estimation
Fit = MultiGASFit(GASSpec, InSampleData)
Forecast = MultiGASFor(Fit, Roll = TRUE, out = OutSampleData)
Forecast
}
Run the code above in your browser using DataLab