R中DCC Copula GARCH模型的预测

时间:2016-01-18 13:23:43

标签: r forecasting portfolio multivariate-testing

我正在尝试预测Copula Garch模型。我曾尝试将dccforecast函数与cGARCHfit一起使用,但结果却是错误的说法,没有适用于'dccforecast'的方法应用于类cGARCHfit的对象。那么我们如何预测dcc copula garch模型?

我有以下可重现的代码。

library(zoo)
library(rugarch)
library(rmgarch)
data("EuStockMarkets")
EuStockLevel <- as.zoo(EuStockMarkets)[,c("DAX","CAC","FTSE")]
EuStockRet <- diff(log(EuStockLevel))

# DCC timecopula MVN

  uspec = ugarchspec(mean.model = list(armaOrder = c(0,0)), variance.model = list(garchOrder = c(1,1), model = "sGARCH", variance.targeting=FALSE), distribution.model = "norm")
  spec1 = cgarchspec(uspec = multispec( replicate(3, uspec) ), asymmetric = TRUE,  distribution.model = list(copula = "mvnorm", method = "Kendall", time.varying = TRUE, transformation = "parametric"))
  fit1 = cgarchfit(spec1, data = EuStockRet, cluster = NULL, solver.control=list(trace=1))
  print(fit1)  

 > fit.copula = cgarchfit(spec1, data = EuStockRet, out.sample = 120, solver = "solnp", solver.control =list(),fit.control = list(eval.se = TRUE, stationarity = TRUE, scale = FALSE),cluster = NULL, fit =NULL, VAR.fit = NULL)
 > dcc.copula.focast=dccforecast(fit.copula, n.ahead = 1, n.roll = 0) 
   Error in UseMethod("dccforecast") : no applicable method for 'dccforecast' applied to an object of class "c('cGARCHfit', 'mGARCHfit', 'GARCHfit', 'rGARCH')"

感谢您的帮助。

由于

1 个答案:

答案 0 :(得分:1)

DCC预测仅适用于dccfits。您可以尝试使用cGARCHsim函数或放开Kendall方法并转到dccfit。虽然使用cGARCHsim进行预测可能会让您感到痛苦,但如果您想要预测较长时间。

请参阅:

??cGARCHsim
  

详细

     

由于没有明确的预测例程,用户应该使用此方法&gt;通过模拟1-ahead,逐步建立n-ahead预测,>获得返回,sigma,Rho等的方法并将它们提供给下一轮&gt;模拟作为起始值。 'rmgarch.tests'文件夹包含&gt;具体示例,说明了这一点。