I am trying to fit a GARCH model with external regressors. My external regressors are composed of production data and a dummy that covers a certain period (07-2008 to 01-2016). When I specify my ugarch with the dummy I have an error message:
Error in modelinc[15] = dim(variance.model$external.regressors)[2] : replacement has length zero
But when the external regressors are without the dummy, I have no problem.
Below is the dummy specification:
model1dum=ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1),
submodel = NULL, external.regressors = dum, variance.targeting = FALSE),
mean.model = list(armaOrder = c(1, 1), include.mean = TRUE, archm = FALSE,
archpow = 1, arfima = FALSE, external.regressors = dum, archex = FALSE),
distribution.model = "norm", start.pars = list(), fixed.pars = list())
Thanks for your help