Orthogonal Linear Regression

Fits a line y=p0+p1*y to a dataset (xdata,ydata) in an orthogonal way.
5,4K download
Aggiornato 13 gen 2005

Nessuna licenza

% Orthogonal linear least square fit of xdata and ydata vectors
% p=linortfit(xdata,ydata) gives the the coefficient-vector p that
% corresponds to the linear expression: y=p(1)+p(2)*x, where p
% is minimized with respect to the objective function
% sum((p(1)+p(2)*xdata-ydata).^2/(1+p(2)^2)).
%
% Example:
%
% %prepare some data
% xdata=0:0.1:10;
% ydata=2+7*xdata+6*randn(size(xdata));
% %orthogonal linear fit
% p=linortfit(xdata,ydata)
% yy=p(1)+p(2)*xdata;
% %compare with normal linear regression
% p0=polyfit(xdata,ydata,1);
% yy0=polyval(p0,xdata);
% %plot to compare data with linear fits
% plot(xdata,ydata,'.',xdata,yy,xdata,yy0,':');

Cita come

Per Sundqvist (2024). Orthogonal Linear Regression (https://www.mathworks.com/matlabcentral/fileexchange/6716-orthogonal-linear-regression), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R13SP1
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Linear and Nonlinear Regression in Help Center e MATLAB Answers
Riconoscimenti

Ispirato: Orthogonal Linear Regression

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0