Is there a _fast_ way to run a rolling regression inside data.table?

后端 未结 2 920
[愿得一人]
[愿得一人] 2020-11-30 08:07

I am running rolling regressions in R, using with the data stored in a data.table.

I have a working version, however it feels like a hack -- I

2条回答
  •  独厮守ぢ
    2020-11-30 08:43

    Not as far as I know; data.table doesn't have any special features for rolling windows. Other packages already implement rolling functionality on vectors, so they can be used in the j of data.table. If they are not efficient enough, and no package has faster versions (?), then it's a case of writing faster versions yourself and (of course) contributing them: either to an existing package or creating your own.

    Related questions (follow links in links) :

    Using data.table to speed up rollapply
    R data.table sliding window
    Rolling regression over multiple columns in R

提交回复
热议问题