Download Solutions to MA242 Quiz 12, 12/12/06 1. Let u1 = 3 4 0 , u1

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Matrix calculus wikipedia , lookup

Cartesian tensor wikipedia , lookup

Linear algebra wikipedia , lookup

Singular-value decomposition wikipedia , lookup

History of algebra wikipedia , lookup

Linear least squares (mathematics) wikipedia , lookup

Basis (linear algebra) wikipedia , lookup

Equation wikipedia , lookup

System of polynomial equations wikipedia , lookup

System of linear equations wikipedia , lookup

Transcript
Solutions to MA242 Quiz 12, 12/12/06
1. Let



−4
3
u1 =  4  , u 1 =  3  ,
0
0



6
and y =  3  .
−2
(a) Verify that {u1 , u2 } is an orthogonal set.
(b) Find the orthogonal decomposition of y, y = ŷ + z, with ŷ ∈ W = Span{u1 , u2 } and
z ∈ W ⊥.
(c) Compute the distance from y to W .
Solution: (a) Since u1 · u2 = −12 + 12 = 0, {u1 , u2 } is an orthogonal set.
(b) ŷ is the orthogonal projection of y onto W , with
y · u1
y · u2
30
15
u1 +
u2 = u1 − u2
u1 · u 1
u2 · u 2
25
25
 

  
6
3
−4
6  3


3 .
4
3
−
=
=
5
5
0
0
0
ŷ =
For z = y − ŷ = (0, 0, −2), y = ŷ + z, and ŷ ∈ W , z ∈ W ⊥ by construction.
(c) The distance from y to W is
p
dist(y, W ) = kzk = 02 + 02 + (−2)2 = 2.
2. Given the data points (x1 , y1 ) = (1, 0), (x2 , y2 ) = (2, 1), (x3 , y3 ) = (4, 2), and (x4 , y4 ) =
(5, 3), find the equation y = β0 + β1 x of the least-squares line that best fits the data.
Solution: The design matrix X and

1
 1
X=
 1
1
observation vector y are
 

0
1



2 
 1 .
and
y
=
 2 
4 
3
5
To set up the normal equations, one computes
6
4 12
T
T
.
and X y =
X X=
25
12 46
Since X T X is invertible (the columns of X are clearly linearly independent), one can
compute β̂ via
−0.6
T
−1 T
β̂ = (X X) X y = · · · =
,
0.7
and the least-squares line is given by y = −0.6 + 0.7x.