Total Least Squares with 5 variables: Matlab example

Antonio Sala, UPV

Difficulty: *** ,       Relevance: PIC,      Duration: 18:30

*Enlace a Spanish version

Materials:    [ Cód.: TLS3x2p4English.mlx ] [ PDF ]

Summary:

This video presents an example of Total Least Squares (TLS) with five interrelated variables. The theory and simpler examples are discussed elsewhere.

When the data is generated, there is a model y1×2 = x1×3Θ3×2, that is, of two equations (we predict two variables from three other ones). This is not known to TLS, obviously, since it has to figure it out.

TLS is convenient because all the data, both X and Y , are corrupted with independent noise of certain standard deviation; indeed, the estimation of ordinary least squares with pseudoinverse is biased. Scaling so that all variables have noise 1, the two smallest singular values of the matrix [Y X] = USV T are, in effect, approximately 1 as predicted by theory. The last two columns of V constitute the implicit model.

To check that it is correct, the scaling is undone and Y = XΘTLS is derived to check that it matches the one used when generating the data (which, in a real application, would be unknown, evidently).

A last rather trivial procedure addresses how to modify the code if each sample of the data is a column instead of a row. The modifications are merely cosmetic, transposing things, and the result is obviously identical.

The video [tls52EN], a continuation of this one, asks what happens if I make a mistake in the scaling: unfortunately, I also get a skewed model in that case.

*Link to my [ whole collection] of videos in English. Link to larger [ Colección completa] in Spanish.

© 2024, A. Sala. All rights reserved for materials from authors affiliated to Universitat Politecnica de Valencia.
Please consult original source/authors for info regarding rights of materials from third parties.