File Exchange

image thumbnail

OLS

version 1.2.0.0 (5.58 KB) by Marco Cococcioni
This functions implements the algorithm of Orthogonal Least Squares.It can be used to rank regressor

25 Downloads

Updated 02 Dec 2014

View License

[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).

Cite As

Marco Cococcioni (2020). OLS (https://www.mathworks.com/matlabcentral/fileexchange/15902-ols), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (8)

I used OLS in my research and worked perfectly. Thank you for sharing.

Steven

Oscar

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).

xiang qian

goog

John D'Errico

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.

Giorgio Alessi

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.

Dimitri Shvorob

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.

Updates

1.2.0.0

Little improvements on the documentation.

1.1.0.0

Little improvement to the short description of the function.

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux