[R-sig-finance] tips and tricks for rolling regressions?

Patrick Burns patrick at burns-stat.com
Wed Aug 25 14:34:46 CEST 2004


Using something like "apply" rather than a for loop is unlikely
to be significantly more efficient (it might even be less) and it
is going to be much less clear what the code is doing.

If a loop is not sufficiently fast for you, there are techniques of
updating the matrix decomposition with each new observation.
I don't know of any such code for R, but I wouldn't be surprised
if there is an implementation or two floating around.

Patrick Burns

Burns Statistics
patrick at burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")

Taher Khan wrote:

>Greetings!
>
>I want to find out if there is a clever way to do a one-step-ahead
>moving window rolling regression using a vectorized operation like with
>apply, rather than a for loop.
>
>Does anyone have a code snippet they would like to share for how they do
>rolling regressions?!?!
>
>Thanks in advance!
>
>_______________________________________________
>R-sig-finance at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>
>  
>



More information about the R-sig-finance mailing list