Вы находитесь на странице: 1из 2

Solutions to CIVL 102 homework

Ch. 1 Problem 3:
(a) We have
y1 ax1 + b
y2 ax2 + b

yN axN + b
x1
x
2
T
Defining k = [y1, y2, , yN] ; A =
...

xN

1
; x = [a, b]T , we can then re-express the
...

1
problem in standard form k ~ Ax, whose solution is, in the equal-weights case,

[a, b]T = (AT A) -1 AT k


where A and k are defined in terms of the xs and ys as above.

(*)

(b) We are minimizing, collectively, the total (squared) vertical gaps, i.e. difference
between actual data point and best-fit line.
(c)
A

1
2
3
5

2.0
2.4
2.7
4.3

1
1
1
1

Using formula (*),

1
1

Transpose of A
2
3
1
1

a = 0.577142857
b = 1.262857143

Plot of the best-fit line vs. data points:

y
4
3
2
1
0 1 2 3 4 5

No other line can provide a better fit to the data, in the least squares sense.

5
1

Ch. 1 Problem 4:
There is only one thing being measured. Since each observation is on the same thing, we
have
1 , 2 , , m
1
1
T
Defining k = [1, 2, , m] ; A = ; unknown x = (1 by 1 vector, i.e. a scalar),
...

we can then express the problem in standard form


k ~ Ax
where the weight matrix is diagonal with the respective diagonal terms w1, w2 , , wm.
The solution is therefore, applying the usual formula,
= (AT WA) -1 AT Wk

where
w1
0
AT WA = [1 1 1]
...

...

w2
0

0...
...

...

0
0
0

w1
w
2
= [1 1 1]
= w1 + w2 + +wm
...
...

wm 1
wm
1
1

AT WA is a scalar, whose matrix inverse is simply 1/ wi


i 1

while
w1
0
T
A Wk = [1 1 1]
...

0
m

i 1

i 1

0
w2
0
0

1
w1 1

m
0...
2 = [1 1 1] w2 2 =
wi i
...
...
...
i 1

... wm m
wm m
...

0
0
0

Hence = 1/ wi wi i ,

m
w

wi
i i /
i 1
i 1
which is the weighted mean of the m observed values. Hence, we see that this frequently
adopted method of estimating a quantity actually satisfies the rigorous requirements of
least squares.
i.e.

Вам также может понравиться