Method returning conditional volatility forecasts and density forecasts of the process.
Forecast(object, ...)# S3 method for MSGARCH_SPEC
Forecast(object, par, data, n.ahead = 1L,
do.return.draw = FALSE, ctr = list(), ...)
# S3 method for MSGARCH_ML_FIT
Forecast(object, new.data = NULL, n.ahead = 1L,
do.return.draw = FALSE, ctr = list(), ...)
# S3 method for MSGARCH_MCMC_FIT
Forecast(object, new.data = NULL, n.ahead = 1L,
do.return.draw = FALSE, ctr = list(), ...)
Model specification of class MSGARCH_SPEC
created with CreateSpec
or fit object of type MSGARCH_ML_FIT
created with FitML
or MSGARCH_MCMC_FIT
created with FitMCMC
.
Not used. Other arguments to Forecast
.
Vector (of size d) or matrix (of size n.mcmc
x d) of parameter
estimates where d must have the same length as the default parameters of the specification.
Vector (of size T) of observations.
Scalar indicating the number of step-ahead evaluation.
Are the sampled simulation draws returned? (Default do.return.draw = FALSE
)
A list of control parameters:
n.sim
(integer >= 0):
Number indicating the number of simulation done for the
conditional vloatlity forecast at n.ahead > 1
. (Default: n.sim = 10000L
)
Vector (of size T*) of new observations. (Default new.data = NULL
)
A list of class MSGARCH_CONDVOL
with the following elements:
vol
: Condititional volatility Forecast (vector of size n.ahead
).
draw
: If do.return.draw = TRUE
:
Draws sample from the predictive distributions (matrix of size n.ahead
x n.sim
).
If do.return.draw = FALSE
: NULL
The MSGARCH_FORECAST
class contains the plot
method.
If a matrix of MCMC posterior draws is given, the Bayesian predictive conditional volatility forecasts are calculated.
# NOT RUN {
# load data
data("SMI", package = "MSGARCH")
# create model specification
# MS(2)-GARCH(1,1)-Normal (default)
spec <- CreateSpec()
# fit the model on the data by ML
fit <- FitML(spec = spec, data = SMI)
# compute the In-sample conditional volatility from the fitted model
forecast <- Forecast(object = fit, n.ahead = 5L)
plot(forecast)
# }
Run the code above in your browser using DataLab