[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).
Marco Cococcioni (2021). OLS (https://www.mathworks.com/matlabcentral/fileexchange/15902-ols), MATLAB Central File Exchange. Retrieved .
I used OLS in my research and worked perfectly. Thank you for sharing.
I would tend to agree with Mr. Shvorob and Mr D'Errico, this is not what I understand orthogonal least-squares. Also, although the code is not as poor as previously seen entries, the general structure is confusing and unnecessarily bloated. In particular, I find the choice to include a demo capability into the function itself, rather than including it as a seperate file, questionable to say the least.
None the less, I'm sure that with a good cleanup, this code will find its uses in some scenarios, if not for the functionality it offers then for its thorough discussion of the theory (although it should probably be moved out of the file to a seperate document).
I'll claim that "orthogonal least squares" is far more commonly used in a statistical context to describe a total least squares problem, as Dimitri suggests. Thus the name is indeed misleading to most of the statistics community.
Given that this submission has been placed in the mathematics/linear algebra category, that standard statistical meaning should be presumed.
I do not agree with review of Dr. Shvorob, since in neural network and fuzzy logic communities "orthogonal least squares" is referred to the problem addressed by the ols.m function written by the author.
I found it very useful. Comments, help and demo is very useful too.
This is not what's usually meant by orthogonal least squares, and nobody refers to those as OLS. The programming is simply atrocious: good luck to anyone who tries to follow this 200+ line behemoth.
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!