Академический Документы
Профессиональный Документы
Культура Документы
= 6 10 3 8(5 4)
Putting the derivative equal to zero, we are minimising the error and the 'x' corresponding
to this becomes the best least squares solution .
Thus 6 10 3 + 8 5 4 = 0
=
Thus = is the best least squares solution.
Now moving to the second part of the problem, we know that the error vector is (10 3,
5 4 ) and =
Hence =
4
3
3
=0
4
Since the above inner product is zero, 'e' and 'A' are perpendicular.
6.2 Suppose the values 1 = 1 and 2 = 7 at times 1 = 1 and 2 = 2 are fitted by a line =
through the origin. Solve = 1 and 2 = 7 by least squares, and sketch the best line.
SOLUTION:
Given are two line equations = 1 and 2 = 7. Writing them in matrix form
1
1
=
which is of the form Ax = b
2
7
1
1
= 1 2
2
7
5 = 15
1
1
1
1
0
2 1 1
1
=
1 2 2
1
21 + 2 = 1 ..........1
1 + 22 = 1 ..........2
Solving equations 1 and 2, we get
To find = :
p=
e=
1 = 2 3
2 = 2 3
1
2 3 0 = 0
1
0
2 3 1 = 0
1
Since the above two inner products equal zero, the error (b - p) is perpendicular to the
columns of 'A'.
6.4 Write out 2 = = and set to zero its derivatives with respect to and , if
1 0
1
= 0 1 , =
,
= 3 .
1 1
4
Compare the resulting equations with = , confirming that calculus as well as
geometry gives the normal equations. Find the solutions and the projection = . Why is
= ?
SOLUTION:
1
= 0
1
0
1 ,
1
=
, = 3
1 0
1
Therefore Ax = b implies 0 1
= 3
1 1
4
The equations obtained are
u=1
v=3
u+v = 4
The error is given by 2 = =
=2 1 +2 +4 =0
2 + = 5 ............1
=2 3 +2 +4 =0
+ 2 = 7
.............2
1
1
3
1
4
2 1
5
=
1 2
7
2 + = 5 ...........3
+ 2 = 7 ...........4
Comparing equations 1&2 with equations 3&4, we can confirm that calculus as well
as geometry gives the normal equations.
To find the best least squares solution :
Solving equations 3&4, we get
1
=
is the best least squares solution
p=
= =
= 1
= 5 = .
0
1
1
9
Sketch and solve a straight line fit that leads to the minimization of the quadratic
4 2 + ( 5)2 + ( + 9)2 . What is the projection of onto the column space of ?
SOLUTION:
+ ( 5)2 + ( + 9)2
= 2 4 + 2 5 + 2( + 9) = 0
=
= 2 4 + 2( + 9) = 0
=
Now = + is the equation of the best fit line .
1
2
2
= =
1
1
1 2 2
1
=
1
2
1 1 4
2
4
7
as the best least squares solution
1
1
3
1
=
2 1
0
2
2
4
6
Error is given by e = b - p =
2
2
1
Also
3
1 0 = 0. Hence 'e' is perpendicular to 'p' .
6
1 = 2 2 1
1
2 =0
2
1
2 = 2 2 1 1 = 0
4
Hence 'e' is perpendicular to the space containing 'p'.
3
2
Thus here q = e and = + = 0 + 2
6
1
with in the column space and (= ) perpendicular to that space.
The space which is perpendicular to the column space is the left Null space. Hence 'q' is in
the left Null space of 'A'.
1
1 2 2
Left Null space of 'A' is found by setting = =
2
1 1 4
3
Solving the above system of equations yields = which is the basis for the left Null
space of 'A' and it is exactly the error vector 'e'. Hence 'e' is in the left Null space of 'A'.
6.7 Find the projection matrix onto the space spanned by 1 = (1, 0, 1) and 2 = 1, 1, 1 .
SOLUTION:
Let A =
1
0
1
1
1
1
2
0
0
3
3
( )1 = 1 6
0
P=
0
2
6.8 Find the best straight line fit (least squares) to the measurements
= 4 at = 2, = 3 at = 1,
= 1 at
= 0, = 0 at = 2
1 2
Then find the projection of = (4, 3, 1, 0) onto the column space of A= 1 1 .
1
0
1
2
SOLUTION:
Let the equation of the best fit line be of the form = + . Then we can write
1 2
4
1 1 = 3
1
1
0
0
1
2
To find the best least squares solution
1
1 1 1 1
1
1
2
2 1 0
1
2
1 = 1 1 1 1
0
2 1 0 2
2
4
3
1
0
97
61
11
35
35
35
35
at = 1, = 1
at = 2, = 1
= 6 at = 0, = 3
= 0 at = 0, = 0
1
0
2
0
1
3
3 = 6
1
5
0
0
1 1 1
1
1 1
1 0 3
2 0 1 2 1 = 1
1
1 0 1 0 0
1 1
0 2
3 1
3
1 6
0 5
0 0
4 + + =
+ + =
+ + =
are the 3 equations in 3 unknowns for the best least squares solution.