Skip to content
Prev 1596 / 15274 Next

best method for rolling forecast based on linear fit

John Putz wrote:
If you're using a linear model as your predictor, it's not strictly 
speaking a "one step ahead" prediction, but rather an ex post rolling 
window analysis.

"best" is highly subjective depending on how fancy you want to be.

zoo has the rollapply function with a configurable window to roll over.

The rollingRegression function in PerformanceAnalytics might make things 
a little easier to use.

There are also many robust regressors that you might wish to consider, 
especially if you're using a relatively short window.

Regards,

    - Brian