Code covered by the BSD License  

Highlights from
Orthogonal Linear Regression

4.0

4.0 | 1 rating Rate this file 18 Downloads (last 30 days) File Size: 2.03 KB File ID: #16800

Orthogonal Linear Regression

by F. Carr

 

10 Oct 2007 (Updated 10 Oct 2007)

Fit data using orthogonal linear regression.

| Watch this File

File Information
Description

LINORTFIT2(X,Y) finds the coefficients of a 1st-order polynomial that best fits the data (X,Y) in an ORTHOGONAL least-squares sense. Consider the line P(1)*t + P(2), and the minimum (Euclidean) distance between this line and each datapoint [X(i) Y(i)] -- LINORTFIT2 finds P(1) and P(2) such that the sum of squared distances is minimized.

LINORTFITN(DATA) finds the coefficients of a hyperplane (in Hessian normal form) that best fits the data in an ORTHOGONAL least-squares sense. Consider the hyperplane
   H = {x | dot(N,x) + C == 0},
and the minimum (Euclidean) distance between this hyperplane and each datapoint DATA(i,:) -- LINORTFITN finds N and C such that the sum of squared distances is minimized.

There is already a file in Matlab Central for orthogonal linear regression in 2 dimensions, but it uses FMINSEARCH (i.e., unconstrained nonlinear optimization by Nelder-Mead simplex search) versus this simpler, numerically stable, multidimensional version based on SVD approximation.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Orthogonal Linear Regression
This submission has inspired the following:
Analytical solution for Orthogonal Linear Least Squares in two dimensions

MATLAB release MATLAB 7.2 (R2006a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
20 Nov 2007 shaho zandi  
21 Nov 2007 Ondrej Kotecky

Some more resources about the problem: http://www.mbari.org/staff/etp3/regress.htm

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
approximation F. Carr 22 Oct 2008 09:31:02
interpolation F. Carr 22 Oct 2008 09:31:02
linear regression F. Carr 22 Oct 2008 09:31:02
interpolation orthogonal F. Carr 22 Oct 2008 09:31:02
coefficients F. Carr 22 Oct 2008 09:31:02
math F. Carr 22 Oct 2008 09:31:02

Contact us at files@mathworks.com