Calculate out of sample linear fit predictions using pseudo-inverse. Please see: https://win-vector.com/2019/01/08/a-beautiful-2-by-2-matrix-identity/. Zero indexed.
xlin_pfits(x, y, w, i, j)
x | NumericVector, explanatory variable (length>=2). |
---|---|
y | NumericVector, values to fit. |
w | NumericVector, weights (positive). |
i | integer, first index (inclusive). |
j | integer, j>=i+2 last index (inclusive); |
vector of predictions.
#> [1] 2.666667 1.285714 1.285714 2.666667