t | 0 | 1 | 2 | 3 | 4 |
---|---|---|---|---|---|
ln(C) | -0.1 | -0.4 | -0.8 | -1.1 | -1.5 |
Solution Let e = [1 1 1 1 1]T, t = [0 1 2 3 4]T, and y = [-0.1 -0.4 -0.8 -1.1 -1.5]T. To do a least squares straight-line fit y = a + bt to the data, we need to find a and b such that ||y - ae - bt|| is a minimum. The norm and inner product are the standard ones for R5. This is equivalent to finding u in the span of e and t that minimizes ||y - u||. Recall that we showed that there is a unique solution to this problem,
u* = < y,u1> u1 + < y,u2> u2
where u1, u2 form an orthonormal basis for the span of e and t. To obtain a and b, we use the Gram-Schmisdt process to find an orthonormal set. First, we letu* = - 1.7441×5-½ e - 1.1068×10-½ (t -2e) = - 0.78e -0.35(t -2e) = - 0.08e - 0.35t,
which yields a = -0.08 and b = -0.35. The line we want is thus y = - 0.08 - 0.35t.
p0(x) = 2-1/2, p1(x) = (3/2)1/2x, and p2(x)= (5/8)1/2(3x2-1).
The polynomial p(x) that minimizes ||f-q|| among all q in P2 is
p(x) = < f, p0> p0(x) + < f, p1> p1(x) + < f, p2> p2(x).
The inner products are all integrals of products of polynomials and exponentials; doing them results in these values:
< f, p0> = 8-1/2(e2 -
e-2)
< f, p1> = (3/32)1/2(e2 +
3e-2)
< f, p2> = (5/128)1/2(e2 -
13e-2)
The final polynomial we get is
p(x) = (1/4)(e2 - e-2) + (3/8)(e2 +
3e-2)x + (5/32)(e2 -
13e-2)(3x2-1).
Here is the required plot.