Quantcast

RUGARCH eGARCH and variance targeting

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

RUGARCH eGARCH and variance targeting

stoyan.stoyanov
Hi all,

Again, I am using the rugarch package to fit a GARCH model to an adjusted daily returns series. I am currently experimenting using an eGARCH instead of the TGARCH that I have been working with. However, once I use the variance targeting option with an eGARCH model my unconditional variance estimates just don't make sense - they take on values >1. I am curious whether this is caused by model mis-specification (eGARCH should not be used together with variance targeting), or whether it might be a bug in rugarch. Any thoughts?
As always, code, data and output are below.

Code:
spec=ugarchspec(variance.model=list(model=eGARCH, garchOrder=c(1,1),
                                      submodel=NULL, external.regressors=NULL, variance.targeting=TRUE),
                mean.model=list(armaOrder=c(2,2), include.mean=TRUE, archm=TRUE,
                                   archpow=1, arfima=FALSE, external.regressors=NULL, archex=FALSE),
                distribution.model = "std", start.pars=list(), fixed.pars=list())

 fit=ugarchfit(spec, data, out.sample=252, solver="solnp", solver.control=list(),
               fit.control=list(stationarity=1, fixed.se=0, scale=0))

print(uncvariance(fit))

Output:
unconditional
     1.000259

Data:
data.csv

Thank you,
Stoyan
Stoyan Stoyanov
The University of Chicago Booth School of Business
MBA Class of 2013
(312) 532-0120 | stoyanov@chicagobooth.edu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: RUGARCH eGARCH and variance targeting

alexios
Some of the bugs with variance.targeting options are still present in
some of the methods. Until that is fixed (in the next update) read the
vignette on how the unconditional variance is calculated for the eGARCH
model (omega/(1-sum(beta))) which you can easily do using the extracted
coefficients.
Also please do not keep attaching datasets to the mailing list.
Bugs/Examples can easily be reproduced using the available pkg datasets
or some randomly generated one.

-Alexios

On 29/06/2012 16:24, stoyan.stoyanov wrote:

> Hi all,
>
> Again, I am using the rugarch package to fit a GARCH model to an adjusted
> daily returns series. I am currently experimenting using an eGARCH instead
> of the TGARCH that I have been working with. However, once I use the
> variance targeting option with an eGARCH model my *unconditional* variance
> estimates just don't make sense - they take on values >1. I am curious
> whether this is caused by model mis-specification (eGARCH should not be used
> together with variance targeting), or whether it might be a bug in rugarch.
> Any thoughts?
> As always, code, data and output are below.
>
> *Code:*
> spec=ugarchspec(variance.model=list(model=eGARCH, garchOrder=c(1,1),
>                                        submodel=NULL,
> external.regressors=NULL, variance.targeting=TRUE),
>                  mean.model=list(armaOrder=c(2,2), include.mean=TRUE,
> archm=TRUE,
>                                     archpow=1, arfima=FALSE,
> external.regressors=NULL, archex=FALSE),
>                  distribution.model = "std", start.pars=list(),
> fixed.pars=list())
>
>   fit=ugarchfit(spec, data, out.sample=252, solver="solnp",
> solver.control=list(),
>                 fit.control=list(stationarity=1, fixed.se=0, scale=0))
>
> print(uncvariance(fit))
>
> *Output:*
> unconditional
>       1.000259
>
> *Data:*
> http://r.789695.n4.nabble.com/file/n4634896/data.csv data.csv
>
> Thank you,
> Stoyan
>
> -----
> Stoyan Stoyanov
> The University of Chicago Booth School of Business
> MBA Class of 2013
> (312) 532-0120 | [hidden email]
> --
> View this message in context: http://r.789695.n4.nabble.com/RUGARCH-eGARCH-and-variance-targeting-tp4634896.html
> Sent from the Rmetrics mailing list archive at Nabble.com.
>
> _______________________________________________
> [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
|  
Report Content as Inappropriate
star

Re: RUGARCH eGARCH and variance targeting

stoyan.stoyanov
Thank you, Alexios.
I will wait for the revision then. Also, a bit off-topic, but it's not really worth a separate thread:
There is a "filtered" series that can be included in the Sigma Standard Error Plots generated by ugarchboot (the green line). My understanding is that this is simply the realized volatility of the out-of-sample observations. I am curious how I can get the filtered series values generating the plot. I assumed it would be simply the standard deviation of returns but my numbers seem different from what is being graphed. Could you please confirm that I am reading the series correctly and advise me on how to get the values?

Thanks,
Stoyan

PS Noted about attaching sample data.
Stoyan Stoyanov
The University of Chicago Booth School of Business
MBA Class of 2013
(312) 532-0120 | stoyanov@chicagobooth.edu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: RUGARCH eGARCH and variance targeting

alexios
Stoyan,

On looking more closely at the variance targeting (VT) for eGARCH models
it is quite problematic. VT-Omega is theoretically supposed to be the
log(mean(residuals^2)) but this does not work at all well in the
optimization problem and instead I have simply used the
mean(residuals^2). Because the uncvariance for eGARCH returns the
exp(...), the value you get when using VT is wrong. The quick fix is to
take the log(...) of what is returned (only when using VT...correct in
all other cases). It is not likely that I will release a fix for this
anytime soon so you should apply this manual 'fix' else do not use
variance targeting with eGARCH. Suggestions welcome.

As for the plot, please take the time to look at the underlying code and
figure out for yourself what it is you need. It is after all open source.

-Alexios

PS There is no 'realized vol' simply filtered vol based on out-of-sample
data and the model.

On 29/06/2012 18:45, stoyan.stoyanov wrote:

> Thank you, Alexios.
> I will wait for the revision then. Also, a bit off-topic, but it's not
> really worth a separate thread:
> There is a "filtered" series that can be included in the Sigma Standard
> Error Plots generated by ugarchboot (the green line). My understanding is
> that this is simply the realized volatility of the out-of-sample
> observations. I am curious how I can get the filtered series values
> generating the plot. I assumed it would be simply the standard deviation of
> returns but my numbers seem different from what is being graphed. Could you
> please confirm that I am reading the series correctly and advise me on how
> to get the values?
>
> Thanks,
> Stoyan
>
> PS Noted about attaching sample data.
>
> -----
> Stoyan Stoyanov
> The University of Chicago Booth School of Business
> MBA Class of 2013
> (312) 532-0120 | [hidden email]
> --
> View this message in context: http://r.789695.n4.nabble.com/RUGARCH-eGARCH-and-variance-targeting-tp4634896p4634911.html
> Sent from the Rmetrics mailing list archive at Nabble.com.
>
> _______________________________________________
> [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
|  
Report Content as Inappropriate
star

Re: RUGARCH eGARCH and variance targeting

stoyan.stoyanov
Thank you Alexios. I may have come across yet another but with the eGARCH specification. It is NOT connected with variance targeting. I tried posting it on the project's bug forum but it may have not gotten through. Just in case:

I fit an eGARCH model to daily adjusted returns and bootstrap a forecast. The forecast looks fine with n.ahead with values of 100 or higher but is completely off with lower values of the forecast period (the difference between a 99 and a 100-period-ahead forecast is striking). I can't see a reason for that other than a bug (correct me if I'm wrong).

Here is the code:

spec=ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(1,1),
                                    submodel=NULL, external.regressors=NULL, variance.targeting=FALSE),
                mean.model=list(armaOrder=c(2,0), include.mean=TRUE, archm=TRUE,
                                archpow=1, arfima=FALSE, external.regressors=NULL, archex=FALSE),
                distribution.model = "std", start.pars=list(), fixed.pars=list())

fit=ugarchfit(spec, data, out.sample=100, solver="solnp", solver.control=list(),
                fit.control=list(stationarity=1, fixed.se=0, scale=0))

boot.pred=ugarchboot(fit, data=NULL, method="partial", n.ahead=99,
                       n.bootfit=100, n.bootpred=500, out.sample=0, rseed=NA, solver="solnp",
                       solver.control=list(), fit.control=list(),
                       external.forecasts=list(mregfor=NULL, vregfor=NULL), parallel=TRUE,
                       parallel.control=list(pkg="snowfall", cores=2))

Please let me know if you need a sample of the code or a copy of the forecast.

Thanks,
Stoyan
Stoyan Stoyanov
The University of Chicago Booth School of Business
MBA Class of 2013
(312) 532-0120 | stoyanov@chicagobooth.edu
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: RUGARCH eGARCH and variance targeting

alexios
Stoyan,

Thanks for the bug report. Please be patient and only post in one place
(the bug report was received but you really shouldn't expect an instant
reply).

This bug seems to stem from the c++ code (for n.ahead>100 and m.sim<100
it uses c code). I'll investigate and issue a fix soon.

-Alexios

On 02/07/2012 15:54, stoyan.stoyanov wrote:

> Thank you Alexios. I may have come across yet another but with the eGARCH
> specification. It is NOT connected with variance targeting. I tried posting
> it on the project's bug forum but it may have not gotten through. Just in
> case:
>
> I fit an eGARCH model to daily adjusted returns and bootstrap a forecast.
> The forecast looks fine with n.ahead with values of 100 or higher but is
> completely off with lower values of the forecast period (the difference
> between a 99 and a 100-period-ahead forecast is striking). I can't see a
> reason for that other than a bug (correct me if I'm wrong).
>
> Here is the code:
>
> spec=ugarchspec(variance.model=list(model="eGARCH", garchOrder=c(1,1),
>                                      submodel=NULL, external.regressors=NULL,
> variance.targeting=FALSE),
>                  mean.model=list(armaOrder=c(2,0), include.mean=TRUE,
> archm=TRUE,
>                                  archpow=1, arfima=FALSE,
> external.regressors=NULL, archex=FALSE),
>                  distribution.model = "std", start.pars=list(),
> fixed.pars=list())
>
> fit=ugarchfit(spec, data, out.sample=100, solver="solnp",
> solver.control=list(),
>                  fit.control=list(stationarity=1, fixed.se=0, scale=0))
>
> boot.pred=ugarchboot(fit, data=NULL, method="partial", n.ahead=99,
>                         n.bootfit=100, n.bootpred=500, out.sample=0,
> rseed=NA, solver="solnp",
>                         solver.control=list(), fit.control=list(),
>                         external.forecasts=list(mregfor=NULL, vregfor=NULL),
> parallel=TRUE,
>                         parallel.control=list(pkg="snowfall", cores=2))
>
> Please let me know if you need a sample of the code or a copy of the
> forecast.
>
> Thanks,
> Stoyan
>
> -----
> Stoyan Stoyanov
> The University of Chicago Booth School of Business
> MBA Class of 2013
> (312) 532-0120 | [hidden email]
> --
> View this message in context: http://r.789695.n4.nabble.com/RUGARCH-eGARCH-and-variance-targeting-tp4634896p4635142.html
> Sent from the Rmetrics mailing list archive at Nabble.com.
>
> _______________________________________________
> [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.
Loading...