2
$\begingroup$

I am estimating a GARCH(1,1) with external regressors and the package rugarch allows me to do it easily. However, to compute QMLE robust standard errors, I need the outer product of the gradient, and therefore, the gradient itself. The code is the following:

uspecSerie1 <- ugarchspec( variance.model = list(model = "sGARCH",garchOrder = c(1,1), external.regressors=as.matrix(Exo)
                                           ),
                     mean.model = list(armaOrder = c(5,4), include.mean = F),
                     distribution.model = "norm")
fit.garchSerie1 <- ugarchfit(spec = uspecSerie1, data = logretSerie1)

The command ugarchfit does not compute the gradient. I tried many things, for example, with the package NumDeriv I tried the following:

grad(ugarchfit, x=fit.garchSerie1@fit$coef, spec = uspecSerie1, data = logretSerie1)

but it does not give results.

Can anyone help me computing the gradient for this object? Thanks

$\endgroup$

1 Answer 1

3
$\begingroup$

I had the same problem recently. When it comes to robust standard errors, I am not quite sure what is implemented in the rugarch package but it is not QMLE.

In the vignette of the rugarch package the author states that the asymptotic covariance matrix is estimated via $$ V =(-A)^{-1}B(-A)^{-1} $$ where $$ A = \sum_{t=1}^T\frac{\partial^2{\cal l }_t (\theta)}{\partial \theta \partial \theta^\top} $$ and $$ B = \sum_{t=1}^T \frac{\partial{\cal l }_t (\theta)}{\partial \theta}\frac{\partial{\cal l }_t (\theta)}{\partial \theta^\top} $$ You are able to extract these matrices form ugarchfit, (for instance, fit.garchSerie1@fit$A) so you have all your building blocks to estimate the covariance matrix.

$\endgroup$
5
  • $\begingroup$ First, thank you for your answer, it helped a lot. I simulated a time-series to check this result and I then compared it with the package fGarch, which has the QMLE option. I found that $A*n = hessian$, where $n$ is the number of observations. Computing ````` A<-fit.garchSerie1@fit$An B<-fit.garchSerie1@fit$Bn sqrt(diag(solve(A)%*%B%*%solve(A))) ```` it gives the robust SE. For me, by reading the formula, it seems like the QMLE SE, and it gives similar (not equal) results as the fGarch packages. PD: the non-robust EE are quite different among the two packages. $\endgroup$ Jul 9, 2021 at 19:52
  • $\begingroup$ Try the following. Set dist = "norm" and then compute the estimate. This should correspond to QMLE. $\endgroup$
    – Lars
    Jul 9, 2021 at 19:57
  • $\begingroup$ If I don´t find a way to compute the gradient by myself (the $n x k$ matrix), I thinks I will be forced to use this SE. But my quest is just begining haha $\endgroup$ Jul 9, 2021 at 19:57
  • $\begingroup$ In which command? $\endgroup$ Jul 9, 2021 at 19:58
  • 1
    $\begingroup$ Since QMLE is maximizing the gaussian likelihood, you could set distribution.model = "norm" in ugarchspec then estimate the model and compute the "sandwich" estimate. The result should be nearly the same as in fgarch. $\endgroup$
    – Lars
    Jul 9, 2021 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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