speed up one step ahead predictions (instead of using rollapply)

后端 未结 1 1364
没有蜡笔的小新
没有蜡笔的小新 2021-01-25 15:29

i use rollapplyin order to create 1-step ahead forecasts of a GARCH(1,1) model (garchFit). An example is provided below:

require(fGarch         


        
相关标签:
1条回答
  • 2021-01-25 16:31
    1. There was a bug in recent versions of rollapply (such as zoo 1.7-6) that did not result in incorrect answers but did cause it to run much more slowly than need be. Try the development version (to become zoo 1.7-7) and see if that is sufficient for your needs:

      install.packages("zoo", repo = "http://r-forge.r-project.org")

    2. You can also try measuring the percentage of time taken up by your function (see ?Rprof) and if its large, i.e. total.pct for FUN is large, then its pointless to look for rollapply alternatives.

    0 讨论(0)
提交回复
热议问题