Consider the following LS-fitted Model with intercept:
y_(t+h) = beta_0 + x_t * beta + u_(t+h)
which is used to generate out-of-sample forecasts of y, h-steps ahead (h=1,2,3,. . . ).
Notes: (1) first estimation window is (1,...,k0) and last window is
(1,....,n-h) for k0 = round(n*pi0). First forecast is yhat(k0+h|k0)
and last forecast is yhat(n|n-h). There are a total of (n-h-k0+1)
forecasts and corresponding forecast errors. (2) this fast version of the
recursive least squares algorithm uses the Sherman-Morrison matrix
formula to avoid matrix inversions at each recursion.