This function applies the k-step recursive least squares scheme to estimate parameters in a linear regression model.
Vector of observation
Matrix of input variables (design matrix)
Vector of parameters (initial value)
Covariance matrix (initial value)
Forgetting factor
Forecast horizon
Length of the input
Dimension of P (np x np)
Start index
Keep only the last kmax rows for next time