Principles of Least Squares
Principles of Least Squares
Principles of Least Squares
v 2
v1
2
v 2
2 v3
2
v n minimum
2
wv 2
w v
1 1
2
w v
2 2
2
w v
3 3
2
wn n minimum
v 2
(1) x + y = 3.0
(2) 2x – y = 1.5
(3) x – y = 0.2
If we consider the right side terms to be measurements, they have
errors and residual terms must be included for consistency.
Example - Continued
x + y – 3.0 = v1
2x – y – 1.5 = v2
x – y – 0.2 = v3
To find the MPVs for x and y we use a least squares solution by
minimizing the sum of squares of residuals.
6 2 x 6.2
2 3 y 1.3
x 1 3 2 6.2 1.514
y 14 2 6 1.3 1.443
We Can also compute residuals:
v1 = 1.514 + 1.443 – 3.0 = -0.044
v2 = 2(1.514) – 1.443 – 1.5 = 0.086
v3 = 1.514 – 1.443 – 0.2 = -0.128
Systematic Formation of Normal
Equations
Resultant Equations
Following derivation in the book results in:
Example – Systematic Approach
Now let’s try the systematic approach to the example.
(1) x + y = 3.0 + v1
(2) 2x – y = 1.5 + v2
(3) x – y = 0.2 + v3
Create a table:
a b l a2 ab b2 al bl
1 1 3.0 1 1 1 3.0 3.0
2 -1 1.5 4 -2 1 3.0 -1.5
1 -1 0.2 1 -1 1 0.2 -0.2
Σ=6 Σ=-2 Σ=3 Σ=6.2 Σ=1.3
Note that this yields the same normal equations.
Matrix Method
Matrix form for linear observation equations:
AX = L + V
Where:
WAX = WL + WV
Normal equations:
ATWAX = NX = ATWL
Matrix Form – Nonlinear System
We use a Taylor series approximation. We will need the Jacobian
matrix and a set of initial approximations.
The observation equations are:
JX = K + V
Where: J is the Jacobian matrix (partial derivatives)
X contains corrections for the approximations
K has observed minus computed values
V has the residuals
The least squares solution is: X = (JTJ)-1JTK = N-1JTK
Weighted Form – Nonlinear System
The observation equations are:
WJX = WK + WV
The least squares solution is:
X = (J WJ) J WK = N J WK
T -1 T -1 T
Example 2
Determine the least squares solution for the following:
F(x,y) = x + y – 2y2 = -4
G(x,y) = x2 + y2 = 8
H(x,y) = 3x – y 2 2
= 7.7
Use x0 = 2, and y0 = 2 for initial approximations.
Example 2 - Continued
Take partial derivatives and form the Jacobian matrix.
F G H
1 2x 6x
x x x
F G H
1 4 y 2y 2 y
y y y
1 1 4 y0 1 7
J 2 x0 2 y0 4 4
6 x0 2 y0 12 4
Example 2 - Continued
Form K matrix and set up least squares solution.
4 F ( x0 , y0 ) 4 (4) 0
K 8 G ( x0 , y0 ) 8 8 0
7.7 H ( x0 , y0 ) 7.7 8 0.3
1 7
1 4 12 161 39
J J
T
4 4
7 4 4 39 81
12 4
0
1 4 12 3.6
J K
T
0
7 4 4 1 .2
0.3
Example2 - Continued
1
161 39 3.6 0.2125
X
39 81 1.2 0. 00458
In matrix form: AX = L + V
xA 1 y A v y A
x 1 m y B v y B
B
xC
1 b yC v yC
x 1 y v
D D yD
Example 3
Fit a straight line to the point x y
points in the table. A 3.00 4.50
Compute m and b by
least squares. B 4.25 4.25
C 5.50 5.50
D 8.00 5.50
In matrix form:
3.00 1 4.50 v A
4.25 1 m 4.25 vB
5.50
1 b 5.50 vC
8.00 1 5.50 v
D
Example 3 - Continued
1
m 1 121.3125 20.7500 105.8125 0.246
X ( A A) ( A L)
T T
b
20 .7500 4. 0000 19 . 7500 3. 663
S0 v 2
0.47
0.48
mn 42
Equation: Ax2 + Bx + C = y
This is still a linear problem in terms of the
unknowns A, B, and C.
0 2 0 1
2 103.84
1 1 1 105.43
2 2 2 1
A 2 104.77
3 3 1 L
4 2 102.21
4 1
2 98.43
5 5 1
93. 41
Parabola Fit Solution - 2
Solve by unweighted least squares solution
1
979 225 55 5354.53 0.813
x ( AT A) 1 AT L 225 55 15 1482.37 1.902
55 15 6 608.09 104.046
0.206
0.295
Compute
0.172
residuals V AX L
0.225
0.216
0. 180
Condition Equations
• Establish all independent, redundant
conditions
• Residual terms are treated as unknowns in the
problem
• Method is suitable for “simple” problems
where there is only one condition (e.g. interior
angles of a polygon, horizon closure)
Condition Equation Example
Condition Example - Continued
Condition Example - Continued
Condition Example - Continued
Note that the angle with the smallest standard deviation has
the smallest residual and the largest SD has the largest
residual
Example Using Observation Equations
Observation Example - Continued
1
1 0 6.7 2 0 0
13438'56"
A 0 1 1
L 8317'35"
W 0 0
1 1 9.9 2 14203'14"360
0 1
0
4.32
1 134
39'00.2"
X ( A WA ) ( A WL)
T T
83 17 '44 .1"
C i2
vi n
i
2
i 1
Angular Closure – Simple Method
3
i
2
i 1
6 .7 2
9 .9 2
4. 3 2
161.39
15" (6.7) 2
v1 4.2"
161.39
15" (9.9) 2
v2 9.1"
161.39
15" (4.3) 2
v3 1.7"
161.39