mslr

Syntax

mslr(Y, X, window, [minPeriods])

Please see Moving Functions (m-functions) for the parameters and windowing logic.

Details

Conduct the simple least-squares regressions of Y on X in a sliding window.

The result is a tuple of two vectors. The first vector is the intercepts and the second vector is the coefficient estimates of X.

Examples

$ Y=1 4 3 9 5 4
$ X=12 31 29 88 67 76
$ mslr(Y,X,4);
([,,,0.177052,0.712557,0.15],[,,,0.101824,0.084418,0.078462])