I have to estimate a VEC GARCH(1,1) model in R. I already tried rmgarch, fGarch, ccgarch, mgarch, tsDyn. Has somebody estimated a model like that?

library(mgarch) #from github vst/mgarch
#load data, time series closing prices, 10 year sample
#DAX 30
getSymbols('^GDAXI', src='yahoo', return.class='ts',from="2005-01-01",    to="2015-01-31")
#S&P 500
getSymbols('^GSPC', src='yahoo', return.class='ts',from="2005-01-01", to="2015-01-31")
GSPC=GSPC[ , "GSPC.Close"]
#Credit Suisse Commodity Return Strat I
getSymbols('CRSOX', src='yahoo', return.class='ts',from="2005-01-01", to="2015-01-31")
#iShares MSCI Emerging Markets
getSymbols('EEM', src='yahoo', return.class='ts',from="2005-01-01", to="2015-01-31")
EEM=EEM[ , "EEM.Close"]
#calculating log returns of the time series
#return matrix
r_t=data.frame(log_r1, log_r2,log_r3, log_r4)
#GARCH estimation
#eGarch(1,1), not multivariate

#Vec Garch(1,1)
Est1=VECM(r_t,lag=1, estim="ML" )

I think the VECM operator isn't useful for my purpose since I need a martrix of 4x4 for alpha and one 4x4 for beta plus 4x1 vector for omega. Can somebody help with a package or code?

  • $\begingroup$ What do you think about my answer? If it is helpful and clear, you may accept it by clicking on the tick mark to the left. Otherwise, you may ask for further clarification. This is how Quantitative Finance SE works. $\endgroup$ Commented Dec 13, 2020 at 18:26

1 Answer 1


VECM-GARCH models do not seem to be implemented in R as of now. However, if you are willing to accept some simplifications, you could perhaps be fine with the existing functionality.

Take, for example, the "rmgarch" package in R. It allows combining univariate conditional mean-conditional variance models with several multivariate GARCH models that take individual component models as inputs (DCC, GOGARCH, copula GARCH).

Consider a bivariate system $(x_{1,t},x_{2,t})$. You could use the functions ugarchspec and ugarchfit from the "rugarch" package to specify and fit individual models for $x_{1,t}$ and $x_{2,t}$ separately. These models would have

  • a conditional mean part that would include own lags, lags of the other series and an error correction term via the argument external.regressors and
  • a conditional variance part that would be the GARCH model of your choice.

You would have to estimate the error correction term in advance using, say, the Johansen procedure (function ca.jo in "vars" package).

So far you would in effect have specified and estimated a VEC model equation by equation, paying attention to the conditional heteroskedasticity via the univariate GARCH models (although the off-diagonal element of the conditional variance matrices would be neglected).

Given the specified component models, you would supply them to the relevant function in the "rmgarch" package to build the multivariate GARCH model of your choice (DCC, GOGARCH or copula GARCH).

One unpleasant aspect of this procedure is that it is not clear how you would select the autoregressive order incorporating the information from the conditional variance part. You could still select the autoregressive order by just neglecting the conditional variance part, though.

  • $\begingroup$ Thanks for your answer i considered something like this procedure. I already changed my "strategy" and so my code. Could I ask you for a favor to look at my code at stackoverflow, stackoverflow.com/questions/35554228/… ? maybe you can give me an advice on this one too. The probleme with the strategy above is that i need the off diagonals for another part. i need this code for my master thesis so I am not allowed to build it step by step. $\endgroup$
    – Nils
    Commented Feb 26, 2016 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.