Description: OLS Orthogonal Least Quares.
[x, ind] = OLS(A,b,r) gives the solution to the least squares problem
using only the best r regressors chosen from the ones present in matrix A.
This function also returns in the vector ind the indexes of the
best r regressors (i.e., the best columns of A to use).
If r is equal to n, the solution x given by OLS is the same as the solution
given by A\b, but in ind we still have the regressors sorted by their
importance. This means that one can perform a feature selection by taking
the first k entries in ind (k<r).
File list (Check if you may need any files):
ols.m