[R-SIG-Finance] Backtesting with ugarchroll( )

Eric Zivot ezivot at u.washington.edu
Tue Oct 23 20:19:31 CEST 2012


I've found this quite easy to do with the zoo function rollapply() (for moving window forecasts) and the PerformanceAnalytics function apply.fromstart() (for recursive - expanding window -  forecasts)

-----Original Message-----
From: r-sig-finance-bounces at r-project.org [mailto:r-sig-finance-bounces at r-project.org] On Behalf Of Alexios Ghalanos
Sent: Tuesday, October 23, 2012 10:43 AM
To: jaimie villanueva
Cc: R-SIG-Finance
Subject: Re: [R-SIG-Finance] Backtesting with ugarchroll( )

Since version 1.0-11, the ugarchroll function only allows a rolling 1 ahead forecast (see Changelog). The alternative had become too complicated to accommodate in this function...you can however wrap your own rolling n-ahead function by combining ugarchfit and ugarchforecast.

-Alexios

Sent from my iPhone

On Oct 23, 2012, at 18:47, jaimie villanueva <jaimie.villanueva at gmail.com> wrote:

> Hi R users,
> 
> I've been trying to perform a backtesting procedure to check the 
> goodness of the estimates of a Garch(1,1) model, over a series of daily log returns.
> 
> The Function I've been using is ugarchroll( ) from rugarch package.
> 
> The code is:
> 
> spec = ugarchspec(variance.model = list(model = "sGARCH", garchOrder = 
> c(1,1)),mean.model = list(armaOrder = c(0,0), include.mean = 
> F),distribution.model = "norm") bktest = ugarchroll(spec, data = Ut, 
> n.ahead = 1,forecast.length = 10, refit.every = 1, refit.window = 
> "moving",solver = "solnp", calculate.VaR = TRUE, VaR.alpha = c(0.005, 
> 0.01, 0.05))
> 
> 
> What I've been trying to run is a moving window backtesting, with 1 
> day ahead forecast, with 10 windows and re-fitting the model every day.
> Up to here, everything is Ok and the results I obtained,  make sense to me.
> But,  what If I would like to check, the goodness of a 1 year (250 
> days) ahead forecast. (all the settings remain equal), instead of a 1 
> day ahead forecast.
> 
> When I run this, I obtained the following Error:
> 
> Done!...all converged.
> Error en `row.names<-.data.frame`(`*tmp*`, value = value) :
>  invalid 'row.names' length
> Además: Mensajes de aviso perdidos
> 1: In doTryCatch(return(expr), name, parentenv, handler) :
>  passing an object of type 'NULL' to .C (arg 8) is deprecated
> 2: In doTryCatch(return(expr), name, parentenv, handler) :
>  passing an object of type 'NULL' to .C (arg 9) is deprecated
> 3: In doTryCatch(return(expr), name, parentenv, handler) :
>  passing an object of type 'NULL' to .C (arg 8) is deprecated
> 4: In doTryCatch(return(expr), name, parentenv, handler) :
>  passing an object of type 'NULL' to .C (arg 9) is deprecated
> 
> 
> What does It really mean. It isn't possible to check the goodness of a 
> 1 year (250 days) ahead forecast ??
> 
> Any opinion would be greatful.
> 
> Thanks in advanced
> 
> Jaimie
> 
>    [[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Finance at r-project.org 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.

_______________________________________________
R-SIG-Finance at r-project.org 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.



More information about the R-SIG-Finance mailing list