Dear all, I have a question regarding the package rugarch. I would like to fit a garch model with exogenous variables using rugarch. My code is as follows, where data.reg is a time series object where the first column corresponds to the response variable and the remainder columns are the exogenous variables. spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1), submodel = NULL, external.regressors = NULL, variance.targeting = FALSE), mean.model = list(armaOrder = c(1, 1), external.regressors = data.reg[,-1])) #, distribution.model = "norm", start.pars = list(), fixed.pars = list())) garch <- ugarchfit(spec=spec,data=data.reg[,1],solver.control=list(trace=0)) When running the second command, the following error appears: Error in pars[idx["mxreg", 1]:idx["mxreg", 2], 1] = fit.mean[i] : replacement has length zero How can I solve this problem? Thanks for your help Corina