PlanetMath (more info)
 Math for the people, by the people. Sponsor PlanetMath
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: Medium Entry average rating: No information on entry rating
[parent] example of linear least squares (Example)

The assumption of linear least squares is that there is a linear relationship between our measurements $ z$ and the variables to be estimated $ x$

$\displaystyle z = Mx + b$ (1)

For this example let us assume that our measurements are given in Table 1 and you can see them plotted in Figure 1.

x -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5
z -1.0 -0.25 0.0 0.25 0.4 0.7 1.0 1.1 1.4 1.8
Table 1: Example Data

The linear least squares solution to fit the given data is given by the equation

$\displaystyle x_{fit} = (A^TA)^{-1}A^Tz$ (2)

The only not so obvious step before using a tool like Matlab, is to form the $ A$ matrix, which is a combination of an identity vector and $ x$ as column vectors, such that

$\displaystyle A = [ \,\, 1 \,\, \vert \,\,x \,\,] $

This is clarified by looking at the example code in Matlab, LinearLeastSquares.m. A plot of fitting the measurement data with a line such that it minimizes the the mean square of the error is shown in Figure 1. The equation of the line to fit this data is then

$\displaystyle z = 0.543 x + 0.947$
\includegraphics[scale=.7]{LinearLeastSquares.eps}
Figure 1: Linear Fit of Example Data




"example of linear least squares" is owned by bloftin.
(view preamble | get metadata)

View style:


This object's parent.
Log in to rate this entry.
(view current ratings)

Cross-references: square, mean, line, column vectors, vector, identity, matrix, MATLAB, obvious, equation, solution, variables, linear least squares

This is version 3 of example of linear least squares, born on 2007-03-21, modified 2007-03-21.
Object id is 9102, canonical name is ExampleOfLinearLeastSquares.
Accessed 1469 times total.

Classification:
AMS MSC15-00 (Linear and multilinear algebra; matrix theory :: General reference works )

Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:
forum policy

No messages.

Interact
post | correct | update request | add example | add (any)