MDSVboot | R Documentation |
Method for forecasting volatility using the MDSV model on log-retruns and realized variances (uniquely or jointly).
MDSVboot(fit, n.ahead = 100, n.bootpred = 500, rseed = NA)
fit |
An object of class |
n.ahead |
An integer designing the forecast horizon. |
n.bootpred |
An integer designing the number of simulation based re-fits the model. Not relevant for one horizon forecast or for non-leverage type model. |
rseed |
An integer use to initialize the random number generator for the resampling with replacement method (if not supplied take randomly). |
The MDSVboot perform the forecasting of the model a different horizon. The forecasting is based on a close form where the estimation does not
involve leverage effect (see Hamilton, 1989. chapter 22 for hidden markov model forecasting). But to take into account the leverage effect,
the forecasting is perform by a bootstrap analysis. The innovations are bootstrapped using a standard normal distribution. This process
is performed in C++
through the Rcpp package. The leverage effect is taken into account according to the FHMV model
(see Augustyniak et al., 2019). For the univariate realized variances forecasting, log-returns are required to add leverage effect.
The class of the output of this function is MDSVboot
. This class has a summary and
print methods to summarize and print the results. See
summary.MDSVboot
and print.MDSVboot
for more details.
A list consisting of:
ModelType : type of model to be fitted.
LEVIER : wheter the fit take the leverage effect into account or not.
N : number of components for the MDSV process.
K : number of states of each MDSV process component.
estimates : estimated parameters.
LogLikelihood : log-likelihood of the model on the data.
AIC : Akaike Information Criteria of the model on the data.
BIC : Bayesian Information Criteria of the model on the data.
data : data use for the fitting.
dates : vector or names of data designing the dates.
n.ahead : integer designing the forecast horizon.
n.bootpred : integer designing the number of simulation based re-fits used to generate the parameter distribution.
rt_sim : matrix of log-returns forecast simulated where the row stand for the simulations and the columns for the horizon.
rt2 : vector of mean by column of the square of rt_sim.
rvt_sim : matrix of realized variances forecast simulated where the row stand for the simulations and the columns for the horizon.
rvt : vector of mean by column of rvt_sim.
Augustyniak, M., Bauwens, L., & Dufays, A. (2019). A new approach to volatility modeling: the factorial hidden Markov volatility model. Journal of Business & Economic Statistics, 37(4), 696-709. https://doi.org/10.1080/07350015.2017.1415910
For fitting MDSVfit
, filtering MDSVfilter
, simulation MDSVsim
and rolling estimation and forecast MDSVroll
.
## Not run:
# MDSV(N=2,K=3) without leverage on univariate log-returns S&P500
data(sp500) # Data loading
N <- 2 # Number of components
K <- 3 # Number of states
ModelType <- 0 # Univariate log-returns
LEVIER <- FALSE # No leverage effect
# Model estimation
out_fit <- MDSVfit(K = K, N = N, data = sp500, ModelType = ModelType, LEVIER = LEVIER)
# Model forecasting (no bootstrapp is need as no leverage)
para <-out_fit$estimates # parameter
out <- MDSVboot(fit = out_fit, n.ahead = 100, rseed = 125)
# Summary
summary(out)
# MDSV(N=3,K=3) with leverage on joint log-returns and realized variances NASDAQ
data(nasdaq) # Data loading
N <- 3 # Number of components
K <- 3 # Number of states
ModelType <- 2 # Joint log-returns and realized variances
LEVIER <- TRUE # No leverage effect
out_fit <- MDSVfit(K = K, N = N, data = nasdaq, ModelType = ModelType, LEVIER = LEVIER)
# Model bootstrap forecasting
out <- MDSVboot(fit = out_fit, n.ahead = 100, n.bootpred = 10000, rseed = 349)
# Summary
summary(out)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.