[R-SIG-Finance] why my rugarch ugarchfit function is slow ?

alexios ghalanos alexios at 4dscape.com
Tue Jul 2 23:37:04 CEST 2013


No idea.

I get:

system.time(ugarchfit(spec, sp500ret,  solver = 'hybrid'))
user  system elapsed
9.66    0.01    9.67

system.time(ugarchfit(spec, mydata,  solver = 'hybrid'))
user  system elapsed
5.74    0.00    5.73

Make sure you've updated all packages used (rugarch from the google 
repository).

You have also chosen to ignore numerous warnings in previous posts to 
this forum about using such a small amount of data, and have in addition 
gone and added a nonlinear GARCH(2,1) model with the sstd distribution. 
I hope you are not using the results for anything other
than filling up empty space on your hard disk.

-Alexios

On 02/07/2013 21:44, ce wrote:
>
> Hi,
>
> I use R 3.0.1, opensuse 12.3 on a sony vaio i3 cpu.  When I use sp500ret data (5523 values) coming from rugarch package, ugarchfit performance is acceptable, but my data has only 102 values, why it takes much longer?
>
>> R
>
> R version 3.0.1 (2013-05-16) -- "Good Sport"
> Copyright (C) 2013 The R Foundation for Statistical Computing
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
>> library("rugarch")
> Loading required package: Rcpp
> Loading required package: RcppArmadillo
> Package Rsolnp (1.14) loaded.  To cite, see citation("Rsolnp")
>
> KernSmooth 2.23 loaded
> Copyright M. P. Wand 1997-2009
>
>> data(sp500ret)
>> dim(sp500ret)
> [1] 5523    1
>
>> spec = ugarchspec(variance.model = list(model = 'fGARCH',submodel = 'NAGARCH', garchOrder = c(2, 1)), distribution = 'sstd')
>> system.time(ugarchfit(spec, sp500ret,  solver = 'hybrid'))
>     user  system elapsed
> 141.562   0.136 142.448
>
>> mydata = c(0.082642875,-0.854761542,-0.077033376,0.406766344,-0.158930181,0.221923295,0.142042082,0.197391055,-0.109232737,-0.139228622,-0.121972401,-0.153521155,-0.046589943,-0.145470513,0.219578485,0.043333125,-0.034798222,-0.162685582,-0.053049221,0.207199901,-0.224930862,0.022989518,-0.028370697,0.010733556,0.065427805,-0.065427805,-0.355150941,-0.065554265,0.239806124,-0.054778206,0.203124684,-0.035550984,0.090971778,-0.033601747,0.066111025,0.029852963,0.030573580,-0.060426543,-0.160342650,0.170392986,0.000000000,-0.133531393,0.011363759,0.345311185,-0.057629113,0.083946421,0.165954579,0.038839833,-0.078104552,-0.088468648,0.117783036,0.074901308,0.002059733,0.066658187,0.038702329,0.211970251,0.016345089,-0.076548451,-0.367989997,-0.067762102,-0.016119382,0.148420005,-0.154689618,-0.213753811,-0.117199094,0.019081238,-0.097374164,0.255933374,0.353296810,0.132887519,-0.044246849,0.098646225,0.067682591,-0.066828985,0.241405811,0.032962773,0.067695013,0.050232125,0.09!
>   2949523,-0.284186788,0.024811748,0.020883211,-0.112795494,0.317639288,0.072787942,0.113058086,0.120935481,0.017040238,-0.011857846,-0.027410019,-0.211765940,-0.054488185,-0.268140917,0.034273403,-0.098347132,0.040078224,-0.010772097,0.000000000,0.000000000,0.000000000,0.000000000,0.537189816)
>
>> system.time(ugarchfit(spec, mydata,  solver = 'hybrid'))
>     user  system elapsed
> 367.052   0.298 369.194
> _______________________________________________
> 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