问题
I have estimated a BEKK(1,1)
model and now I want to have forecast values of the model. Following are the R
codes to estimate the BEKK(1,1)
model.
> install.packages('MTS')
> install.packages('rmgarch')
> simulated <- simulateBEKK(2, 1000, c(1, 1))
##prepare the matrix:
> simulated <- do.call(cbind, simulated$eps)
##Estimate with default arguments:
> estimated <- BEKK(simulated)
> diagnoseBEKK(estimated)
回答1:
Since your question (is it a question?) doesn't really make clear what you are trying to achieve (and mixes up packages / commands) I will answer to what I think you want to know.
First of all, the commands you describe come from the package mgarchBEKK
, not MTS
or rmgarch
.
I will stick with your example, which has two series (not five, like implied by your title).
1. Model simulation and estimation
You run your code (example actually comes from the documentation, page 4:
install.packages('mgarchBEKK')
library('mgarchBEKK')
## Simulate series: (2 = number of series to be simulated,
## 1000 = length of series to be simulated,
## c(1,1) = BEKK(p, q) order.
simulated = simulateBEKK(2, 1000, c(1,1))
## Prepare the matrix:
simulated = do.call(cbind, simulated$eps)
## Estimate with default arguments:
estimated = BEKK(simulated)
Now you have all the information stored in estimated
. Assuming your input variables would be e. g. daily return series from shares or indices the last value for H would be your forecast for the conditional variance of tomorrow and the last value for cor your forecast for the conditional correlation of tomorrow. So basically a 1-day-forecast.
2. Preparing the data
You could store the conditional standarddeviation and conditional correlation in a sepearte data frame for convienience. Like:
results = data.frame('bekk.csd.variable1' = estimated$sd[[1]],
'bekk.csd.variable2' = estimated$sd[[2]],
'bekk.ccor.var1_var2' = estimated$[[1]][[2]])
3. Show the results
And then show your 1-day/period-forecast for the conditional volatility and conditional correlation:
tail(results, n = 1)
回答2:
Numbers,
I think your code is missing something. On part 2. Here is how I think it could be fixed:
results = data.frame('bekk.csd.variable1' = estimated$sd[[1]],
'bekk.csd.variable2' = estimated$sd[[2]],
'bekk.ccor.var1_var2' = estimated$cor[[1]][[2]])
Hope this helps.
来源:https://stackoverflow.com/questions/44906642/forecasting-of-bekk1-1-model-for-5-variables