ArticleslgStudy

mathematics

Total least squares

Total least squares is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Total least squares rather than just read about it. In short: In applied statistics, total least squares is a type of errors-in-variables regression, a least squares data modeling technique in which observational errors on both dependent and independent variables are taken into account. It is a generalization of Deming regression and also of orthogonal regression, and can be applied to both linear and non-linear models.

Total least squares — main illustration
Total least squares — illustration

Key takeaways

  • Total least squares belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Total least squares to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Total least squares from memory before moving on to harder problems.

Reference excerpt

In applied statistics, total least squares is a type of errors-in-variables regression, a least squares data modeling technique in which observational errors on both dependent and independent variables are taken into account. It is a generalization of Deming regression and also of orthogonal regression, and can be applied to both linear and non-linear models. The total least squares approximation of the data is generically equivalent to the best, in the Frobenius norm, low-rank approximation of the data matrix.

Linear model

Background In the least squares method of data modeling, the objective function to be minimized, S, is a quadratic form:

S=𝐫𝐓𝐖𝐫, where r is the vector of residuals and W is a weighting matrix. In linear least squares the model contains equations which are linear in the parameters appearing in the parameter vector 𝜷, so the residuals are given by

𝐫=𝐲−𝐗𝜷. There are m observations in y and n parameters in β with m>n. X is a m×n matrix whose elements are either constants or functions of the independent variables, x. The weight matrix W is, ideally, the inverse of the variance-covariance matrix 𝐌y of the observations y. The independent variables are assumed to be error-free. The parameter estimates are found by setting the gradient equations to zero, which results in the normal equations

𝐗𝐓𝐖𝐗𝜷=𝐗𝐓𝐖𝐲.

Allowing observation errors in all variables Now, suppose that both x and y are observed subject to error, with variance-covariance matrices 𝐌x and 𝐌y respectively. In this case the objective function can be written as

S=𝐫𝐱𝐓𝐌𝐱−𝟏𝐫𝐱+𝐫𝐲𝐓𝐌𝐲−𝟏𝐫𝐲, where 𝐫x and 𝐫y are the residuals in x and y respectively. Clearly these residuals cannot be independent of each other, but they must be constrained by some kind of relationship. Writing the model function as 𝐟(𝐫𝐱,𝐫𝐲,𝜷), the constraints are expressed by m condition equations.

𝐅=𝜟𝐲−𝝏𝐟𝝏𝐫𝐱𝐫𝐱−𝝏𝐟𝝏𝐫𝐲𝐫𝐲−𝐗𝜟𝜷=𝟎. Thus, the problem is to minimize the objective function subject to the m constraints. It is solved by the use of Lagrange multipliers. After some algebraic manipulations, the result is obtained.

𝐗𝐓𝐌−𝟏𝐗𝜟𝜷=𝐗𝐓𝐌−𝟏𝜟𝐲, or alternatively 𝐗𝐓𝐌−𝟏𝐗𝜷=𝐗𝐓𝐌−𝟏𝐲, where M is the variance-covariance matrix relative to both independent and dependent variables.

𝐌=𝐊𝐱𝐌𝐱𝐊𝐱𝐓+𝐊𝐲𝐌𝐲𝐊𝐲𝐓; 𝐊𝐱=−𝝏𝐟𝝏𝐫𝐱, 𝐊𝐲=−𝝏𝐟𝝏𝐫𝐲.

Example When the data errors are uncorrelated, all matrices M and W are diagonal. Then, take the example of straight line fitting.

f(xi,β)=α+βxi in this case

Mii=σy,i2+β2σx,i2 showing how the variance at the ith point is determined by the variances of both independent and dependent variables and by the model being used to fit the data. The expression may be generalized by noting that the parameter β is the slope of the line.

Mii=σy,i2+(dydx)i2σx,i2 An expression of this type is used in fitting pH titration data where a small error on x translates to a large error on y when the slope is large.

Algebraic point of view As was shown in 1980 by Golub and Van Loan, the TLS problem does not have a solution in general. The following considers the simple case where a unique solution exists without making any particular assumptions. The computation of the TLS using singular value decomposition (SVD) is described in standard texts. We can solve the equation

XB≈Y for B where X is m-by-n and Y is m-by-k. That is, we seek to find B that minimizes error matrices E and F for X and Y respectively. That is,

argminB,E,F‖[EF]‖F,(X+E)B=Y+F where [EF] is the augmented matrix with E and F side by side and ‖⋅‖F is the Frobenius norm, the square root of the sum of the squares of all entries in a matrix and so equivalently the square root of the sum of squares of the lengths of the rows or columns of the matrix. This can be rewritten as

[(X+E)(Y+F)][B−Ik]=0. where Ik is the k×k identity matrix. The goal is then to find [EF] that reduces the rank of [XY] by k. Define [U][Σ][V]∗ to be the singular value decomposition of the augmented matrix [XY].

[XY]=[UXUY][ΣX00ΣY][VXXVXYVYXVYY]∗=[UXUY][ΣX00ΣY][VXX∗VYX∗VXY∗VYY∗] where V is partitioned into blocks corresponding to the shape of X and Y. Using the Eckart–Young theorem, the approximation minimising the norm of the error is such that matrices U and V are unchanged, while the smallest k singular values are replaced with zeroes. That is, we want

[(X+E)(Y+F)]=[UXUY][ΣX000k×k][VXXVXYVYXVYY]∗ so by linearity,

[EF]=−[UXUY][0n×n00ΣY][VXXVXYVYXVYY]∗. We can then remove blocks from the U and Σ matrices, simplifying to

[EF]=−UYΣY[VXYVYY]∗=−[XY][VXYVYY][VXYVYY]∗. This provides E and F so that

[(X+E)(Y+F)][VXYVYY]=0. Now if VYY is nonsingular, which is not always the case (note that the behavior of TLS when VYY is singular is not well understood yet), we can then right multiply both sides by −VYY−1 to bring the bottom block of the right matrix to the negative identity, giving

[(X+E)(Y+F)][−VXYVYY−1−VYYVYY−1]=[(X+E)(Y+F)][B−Ik]=0, and so

B=−VXYVYY−1. A naive GNU Octave/MATLAB implementation of this is:

The way described above of solving the problem, which requires that the matrix VYY is nonsingular, can be slightly extended by the so-called classical TLS algorithm.

Computation The standard implementation of classical TLS algorithm written by Van Huffel is available through Netlib, see also. All modern implementations based, for example, on solving a sequence of ordinary least squares problems, approximate the matrix B (denoted X in the literature), as introduced by Van Huffel and Vandewalle. It is worth noting, that this solution is, however, only the TLS solution when rank⁡(W(q,e))=e and rank⁡(V12(−e))=d−e. In other cases it represents a BT-TLS, a solution of the truncated total least squares problem (T-TLS). The T-TLS has a regularization property that real TLS does not have.

Non-linear model For non-linear systems similar reasoning shows that the normal equations for an iteration cycle can be written as

𝐉𝐓𝐌−𝟏𝐉𝜟𝜷=𝐉𝐓𝐌−𝟏𝜟𝐲, where 𝐉 is the Jacobian matrix.

Geometrical interpretation

… excerpt ends here. Continue reading the full article.

Illustrations

Total least squares: The bivariate (Deming regression) case of total least squares. The red lines show the error in both x and y. This is different from the traditional least squares method which measures error parallel to the y axis. The case shown, with deviations measured perpendicularly, arises when errors in x and y have equal variances.
The bivariate (Deming regression) case of total least squares. The red lines show the error in both x and y. This is different from the traditional least squares method which measures error parallel to the y axis. The case shown, with deviations measured perpendicularly, arises when errors in x and y have equal variances.

Worked examples

Example 1 — a first encounter with Total least squares

Start with the simplest possible case. Write down what Total least squares claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Total least squares before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Total least squares ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Total least squares

In research
Total least squares appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Total least squares in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Total least squares is common in secondary-school and first-year university syllabi. It links to neighbouring topics Applied mathematics, Curve fitting, Least squares, so understanding it makes those chapters shorter.
In everyday life
Look for Total least squares outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Total least squares” →

How to study Total least squares in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Total least squares means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Total least squares out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Total least squares in simple terms?

In applied statistics, total least squares is a type of errors-in-variables regression, a least squares data modeling technique in which observational errors on both dependent and independent variables are taken into account. It is a generalization of Deming regression and also of orthogonal regres…

Why does Total least squares matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Total least squares?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Total least squares.

Tags

  • Applied mathematics
  • Curve fitting
  • Least squares
  • Regression models

Keep exploring