Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate Total least squares in R? (Orthogonal regression) [closed]

Tags:

r

regression

I didn't find a function to calculate the orthogonal regression (TLS - Total Least Squares).

Is there a package with this kind of function?

Update: I mean calculate the distance of each point symmetrically and not asymmetrically as lm() does.

like image 540
Bleak Avatar asked Jul 29 '11 12:07

Bleak


People also ask

How do you calculate orthogonal regression?

OLS fits the equation y=βx by minimizing squared distances between observed values y and predicted values ˆy. TLS fits the same equation by minimizing squared distances between (x,y) points and their projection on the line. In this simplest case TLS line is simply the first principal component of the 2D data.

Why is TLS better than OLS?

The crucial difference between the OLS and TLS methods is that the former minimizes the error only for the vertical variable whereas the latter minimizes the errors in both the horizontal and vertical directions (Markovsky and Van Huffel 2007).

What is orthogonal distance regression?

Orthogonal Distance Regresson (ODR) is the name given to the com- putational problem associated with finding the mciximum likelihood esti- mators of parameters in measurement error models in the case of normally. distributed errors.


2 Answers

You might want to consider the Deming() function in package MethComp [function info]. The package also contains a detailed derivation of the theory behind Deming regression.

The following search of the R Archives also provide plenty of options:

  • Total Least Squares
  • Deming regression

Your multiple questions on CrossValidated, here and R-Help imply that you need to do a bit more work to describe exactly what you want to do, as the terms "Total least squares" and "orthogonal regression" carry some degree of ambiguity about the actual technique wanted.

like image 159
Gavin Simpson Avatar answered Sep 18 '22 11:09

Gavin Simpson


Two answers:

  1. gx.rma in the rgr package appears to do this.
  2. Brian Ripley has given a succinct answer on this thread. Basically, you're looking for PCA, and he suggests princomp. I do, too.
like image 34
Iterator Avatar answered Sep 18 '22 11:09

Iterator