[R-SIG-Finance] Computational Time using rugarch package
alexios ghalanos
alexios at 4dscape.com
Mon Jun 10 18:33:15 CEST 2013
I forgot to mention that you can also use a cluster object (if you have
the computational resources) to speed things up so that
you don't wait '7 hours' for the 2308 re-estimations of the model.
-Alexios
On 06/10/2013 07:27 PM, alexios ghalanos wrote:
> Assume the object you tried to estimate is called 'roll'.
>
> Then do the following:
>
> roll = resume(roll, solver="gosolnp")
>
> The 'resume' method takes a uGARCHroll object which contains
> non-converged 'windows' and re-estimates
> them subject to additional options (e.g. different solver, control
> options, starting parameters in a revised
> uGARCHspec etc).
>
> You might also like to read the post on rolling GARCH forecasts which
> explains how to 'roll your own' rolling forecast:
> http://www.unstarched.net/2012/12/26/rolling-garch-forecasts/
>
> -Alexios
>
> On 06/10/2013 07:18 PM, Ivanov Ruporvrich wrote:
>>
>> Thanks a lot for your answer,
>> I tried your code and run it for 7 hours, but it did not completely
>> suceed:
>>
>> First of all, I got different warning messages which say:
>>
>>
>> 27: In .makefitmodel(garchmodel = "fGARCH", f = .fgarchLLH, ... :
>> rugarch-->warning: failed to invert hessian
>>
>>
>> Two warning messages say:
>> 28: In nlminb(start = pars, objective = fun, gradient = gr, ... :
>> unrecognized control elements named ‘tol’ ignored
>>
>> One further message says:
>> 30: In .rollfdensity(spec = spec, data = data, n.ahead = n.ahead, ... :
>> non-converged estimation windows present...resubsmit object with
>> different solver parameters...
>>
>>
>> If I want to look at the output via the show() command, I get the
>> message:
>> Object contains non-converged estimation windows. Use resume method
>> to re-estimate.
>>
>>
>> So my question now is: How can I reestimate just the windows which
>> did not converge? So how do I have to apply the resume method in this
>> case?
>>
>> From your excellent short
>> "a-short-introduction-to-the-rugarch-package" of the unstarched
>> homepage it says:
>>
>>
>> "A key feature of this method is the existence of a rescue method
>> called resume which allows the resumption of the estimation when
>> there are
>> non-converged windows, by submitting the resulting object into resume
>> with the option of using a different solver, control parameters etc.
>> This process can be continued until all windows converge, thus not
>> wasting time and resources by having to resubmit the whole problem from
>> scratch."
>>
>> But I don't know how to code this in my case? So what options do I
>> have to take and what code should I run?
>>
>>
>> Thanks a lot again for your help,
>> Ivanov
>>
>>
>>
>>
>> ________________________________
>> Von: alexios ghalanos <alexios at 4dscape.com>
>> An: Ivanov Ruporvrich <ivanovruporvrich at yahoo.com>
>> CC: "r-sig-finance at r-project.org" <r-sig-finance at r-project.org>;
>> alexios at 4dscape.com
>> Gesendet: 9:12 Montag, 10.Juni 2013
>> Betreff: Re: [R-SIG-Finance] Computational Time using rugarch package
>>
>>
>>
>> You say that you are aware that more observations would be better to
>> get more consistent estimates, yet you
>> use a moving window of size 262 on a highly non-linear variant of
>> GARCH (NAGARCH) with a non-normal distribution,
>> and you wonder WHY you have difficulty in estimating the model?
>>
>> This issue of dataset size has been extensively covered in this
>> forum in the past (and very recently in fact), and in the
>> FAQ of the vignette where suggestions are also made about the use
>> of the scaling option, setting
>> solver parameters or using alternative solvers.
>>
>> -Alexios
>>
>> Try:
>> rollmodel = ugarchroll(garchspecification, mydata, n.start=262,
>> refit.every = 1, refit.window = 'moving',
>> window.size = 262,
>> calculate.VaR = TRUE, keep.coef = TRUE,
>> solver.control=list(tol=1e-6, trace=1),
>> fit.control=list(scale=1))
>>
>> On 06/10/2013 08:44 AM, Ivanov Ruporvrich wrote:
>>
>> Hi,
>> I am using the rugarch package in R and I have a certain model, which
>> I want to reestimate on a daily basis using ugarchroll. I am aware of
>> the fact, that my problem is caused by the reason, that I do the
>> reestimation daily, but since I really need the daily reestimation I
>> cannot change this parameter (change to an higher number). My problem
>> is, that reestimation on a daily basis takes a lot of time. I ran my
>> pc for 7 hours but I did not get a result, when I pressed ESC I got 4
>> or 5 warning messages that the hessian could not be inverted. So my
>> main question is: Is there any chance to get this estimation running?
>> Maybe change the solver or something like that? I do not have a
>> problem with running R for like 6 hours or so, at least if I get a
>> result afterwards. My R code is: (I use 262 observations for each
>> window, I am aware of the fact, that
>> more observations would be better in order to get more consistent
>> estimates.) library(rugarch)
>> garchspecification<-ugarchspec(variance.model =
>> list(model="fGARCH",submodel="NAGARCH", garchOrder = c(1, 1)),
>> mean.model = list(armaOrder = c(1, 0), include.mean = FALSE),
>> distribution.model = "ged") rollmodel =
>> ugarchroll(garchspecification, mydata, n.start=262,
>> refit.every = 1, refit.window = 'moving', window.size = 262,
>> calculate.VaR = TRUE, keep.coef = TRUE) I attached the data.
>> Thanks a lot for your help,
>> Ivanov
>>>
>>> _______________________________________________
>>> 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