t | 0 | 1 | 2 | 3 | 4 |
---|---|---|---|---|---|
ln(C) | − 0.1 | − 0.4 | − 0.8 | − 1.1 | − 1.5 |
Solution Let u0 = [1 1 1 1 1]T, u1 = [0 1 2 3 4]T, and yd = [-0.1 -0.4 -0.8 -1.1 -1.5]T. To do a least squares straight-line fit y = a0 + a1t to the data, we need to find a0 and a1 such that ||y - a0 u0 - a1 u1|| is a minimum. The norm and inner product are the standard ones for R5. This is equivalent to finding w in span{u0u, 1} that minimizes ||yd - w||. Recall that we showed that there is a unique solution to this problem,
wmin = < yd | v0> v1 + < yd | v1> v1
where v0, v1 form an orthonormal basis for span{u0, u1}. To obtain a0 and a1, we first use the Gram-Schmidt process to find the orthonormal set {v0, v1}. Let y0 = u0, and then setwmin = - 1.7441×5-½ u0 - 1.1068×10-½ (u1 - 2u0) = - 0.08u0 - 0.35u1,
which yields a0 = -0.08 and a1 = -0.35. The line we want is thus y = - 0.08 - 0.35t.
Solution This problem is really a straightforward application
of the minimization results we got earlier. The inner product and norm
are
< f | g > = ∫ −11 f(x)g(x)dx and
||f|| = (∫ −11
f(x)2dx)½.
As we saw in class, the normalized Legendre polynomials of degree 0,
1, and 2 are
p0(x) = 2-1/2, p1(x) = (3/2)1/2x, and p2(x)= (5/8)1/2(3x2-1).
The quadratic polynomial p that minimizes ||f-q|| among all quadratics q 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.