rugarch robust covariance matrix definition

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

rugarch robust covariance matrix definition

Curtis Miller
Hello all,

I have a question about the robust standard errors computed by rugarch.

Assume that an rugarch fit was computed and stored in fit, and that the
covariance matrix was extracted via vcov(fit, robust = TRUE); call this
V. Then suppose we get the Hessian matrix via fit@fit$hessian; call this H.

In fGarch standard errors were computed using the Eicker-White sandwich
estimator, V = H^{-1} G^T G H^{-1}. I am particularly interesting in
extracting G^T G, if not G itself. (I have my reasons.) It is possible
to solve this equation: H V H = G^T G.

What I want to know is if vcov(fit, robust = TRUE) returns this sandwich
estimator, like in fGarch; the documentation does not say how the robust
standard errors are computed.

If this is not the case, anyone know how to get G?

Curtis

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
Reply | Threaded
Open this post in threaded view
|

Re: rugarch robust covariance matrix definition

alexios
Curtis,

You've written a very scathing critique of fGarch in your blog:

"I’m leaving this post up though as a warning to others to avoid fGarch
in the future" which I believe is both unjust and unwarranted.

I suggest you read this blog post on parameter uncertainty and data size:

http://www.unstarched.net/2012/12/26/garch-parameter-uncertainty-and-data-size/

GARCH models require a reasonable amount of data to properly estimate
the persistence in a series, so 100 data points is unlikely to be enough
(until recently rugarch did not allow for anything less than this but
had been removed at the request of a user).

With regards to the robust standard errors, install the development
version from bitbucket:

devtools::install_bitbucket("alexiosg/rugarch")

And run the demo code below:

########################################################
library(rugarch)
library(xts)
data(sp500ret)

spx<-xts(as.numeric(sp500ret[,1]), as.Date(rownames(sp500ret)))
spec<-ugarchspec()

fit<-ugarchfit(spec, spx, fit.control=list(scale=1))

A=fit@fit$A
n = fit@model$modeldata$T
B = fit@fit$B
Ainv = try( solve(A), silent = TRUE )
vcv=(Ainv%*%B%*%Ainv)/n
all.equal(vcv,vcov(fit, robust=TRUE))

########################################################

The routine to calculate A and B can be found in robustvcv function
under the file rugarch-numderiv.R

Both myself and the late Diethelm Wurtz benchmarked our estimation codes
with numerous other commercial and open source packages and found them
to perform robustly on a number of cases (but certainly not every corner
case). If you feel let down by fGarch or rugarch, then I suggest you try
and see how other packages perform before trashing them.


-Alexios

On 11/14/2017 2:30 PM, Curtis Miller wrote:

> Hello all,
>
> I have a question about the robust standard errors computed by rugarch.
>
> Assume that an rugarch fit was computed and stored in fit, and that the
> covariance matrix was extracted via vcov(fit, robust = TRUE); call this
> V. Then suppose we get the Hessian matrix via fit@fit$hessian; call this H.
>
> In fGarch standard errors were computed using the Eicker-White sandwich
> estimator, V = H^{-1} G^T G H^{-1}. I am particularly interesting in
> extracting G^T G, if not G itself. (I have my reasons.) It is possible
> to solve this equation: H V H = G^T G.
>
> What I want to know is if vcov(fit, robust = TRUE) returns this sandwich
> estimator, like in fGarch; the documentation does not say how the robust
> standard errors are computed.
>
> If this is not the case, anyone know how to get G?
>
> Curtis
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
>

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.
Reply | Threaded
Open this post in threaded view
|

Re: rugarch robust covariance matrix definition

Rmetrics mailing list
Consistent with the comments of Alexios, a paper "Software implementation and testing of GARCH models" available at https://www.nag.co.uk/doc/TechRep/pdf/Tr4_00.pdf concluded that

"reliable parameter estimates and associated standard errors could only be
achieved when at least 300 observations were included in the GARCH model. More difficult
GARCH models (those with more parameters to estimate or higher volatility memory) were found
to require even more observations to obtain consistent parameter estimates."


Vivek Rao
Boston, MA
________________________________
From: alexios galanos <[hidden email]>
To: [hidden email]
Sent: Tuesday, November 14, 2017 9:29 PM
Subject: Re: [R-SIG-Finance] rugarch robust covariance matrix definition



Curtis,

You've written a very scathing critique of fGarch in your blog:

"I’m leaving this post up though as a warning to others to avoid fGarch
in the future" which I believe is both unjust and unwarranted.

I suggest you read this blog post on parameter uncertainty and data size:

http://www.unstarched.net/2012/12/26/garch-parameter-uncertainty-and-data-size/

GARCH models require a reasonable amount of data to properly estimate
the persistence in a series, so 100 data points is unlikely to be enough
(until recently rugarch did not allow for anything less than this but
had been removed at the request of a user).

With regards to the robust standard errors, install the development
version from bitbucket:

devtools::install_bitbucket("alexiosg/rugarch")

And run the demo code below:

########################################################
library(rugarch)
library(xts)
data(sp500ret)

spx<-xts(as.numeric(sp500ret[,1]), as.Date(rownames(sp500ret)))
spec<-ugarchspec()

fit<-ugarchfit(spec, spx, fit.control=list(scale=1))

A=fit@fit$A
n = fit@model$modeldata$T
B = fit@fit$B
Ainv = try( solve(A), silent = TRUE )
vcv=(Ainv%*%B%*%Ainv)/n
all.equal(vcv,vcov(fit, robust=TRUE))

########################################################

The routine to calculate A and B can be found in robustvcv function
under the file rugarch-numderiv.R

Both myself and the late Diethelm Wurtz benchmarked our estimation codes
with numerous other commercial and open source packages and found them
to perform robustly on a number of cases (but certainly not every corner
case). If you feel let down by fGarch or rugarch, then I suggest you try
and see how other packages perform before trashing them.


-Alexios

On 11/14/2017 2:30 PM, Curtis Miller wrote:

> Hello all,
>
> I have a question about the robust standard errors computed by rugarch.
>
> Assume that an rugarch fit was computed and stored in fit, and that the
> covariance matrix was extracted via vcov(fit, robust = TRUE); call this
> V. Then suppose we get the Hessian matrix via fit@fit$hessian; call this H.
>
> In fGarch standard errors were computed using the Eicker-White sandwich
> estimator, V = H^{-1} G^T G H^{-1}. I am particularly interesting in
> extracting G^T G, if not G itself. (I have my reasons.) It is possible
> to solve this equation: H V H = G^T G.
>
> What I want to know is if vcov(fit, robust = TRUE) returns this sandwich
> estimator, like in fGarch; the documentation does not say how the robust
> standard errors are computed.
>
> If this is not the case, anyone know how to get G?
>
> Curtis
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.

>

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.

_______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.