Docsity

Least-Squares Quadratic Polynomial: Finding the Coefficients and Condition Number, Assignments of Mathematics

Toggle sidebar
bg1
Math 151B Homework #7 – Due Friday 3/6
1. least squares
[Note: feel free to use octave/matlab to compute matrix inverses – you don’t have to do them by
hand.]
Consider the data y(−2) = 3, y(−1) = −2, y(0) = 0, y(1) = 4, and y(2) = 5. We want to
find the least-squares quadratic polynomial for these points.
a. Write down the curvature matrix.
Answer:
The curvature matrix is
Pm
i=1 x0
iPm
i=1 x1
iPm
i=1 x2
i
Pm
i=1 x1
iPm
i=1 x2
iPm
i=1 x3
i
Pm
i=1 x2
iPm
i=1 x3
iPm
i=1 x4
i
=
5 0 10
0 10 0
10 0 34
b. What is the condition number of this matrix.
Answer:
||A||∞= 44 and ||A||2= 37.114.
||A−1||∞= 0.62857 and ||A−1||2= 0.5302.
K∞(A) = 27.657 and K2(A) = 19.678.
c. Use the Jacobi preconditioner, and compute the new condition number.
Answer:
˜
A=D−1A
=
1/5 0 0
0 1/10 0
0 0 1/34
5 0 10
0 10 0
10 0 34
=
1 0 2
0 1 0
10/34 0 1
||A||∞= 3 and ||A||2= 2.46.
||A−1||∞= 7.3 and ||A−1||2= 5.98.
K∞(A) = 21.9 and K2(A) = 14.71.
d. Repeat with the Gauss-Seidel preconditioner.
Answer:
˜
A= (D+L)−1A
=
1 0 2
0 1 0
000.412
pf3

Partial preview of the text

Download Least-Squares Quadratic Polynomial: Finding the Coefficients and Condition Number and more Assignments Mathematics in PDF only on Docsity!

Math 151B Homework #7 – Due Friday 3/

  1. least squares

[Note: feel free to use octave/matlab to compute matrix inverses – you don’t have to do them by

hand.]

Consider the data y(−2) = 3, y(−1) = −2, y(0) = 0, y(1) = 4, and y(2) = 5. We want to

find the least-squares quadratic polynomial for these points.

a. Write down the curvature matrix.

Answer:

The curvature matrix is

∑m

i=1 x

0 i

∑m

i=1 x

1 i

∑m

i=1 x

2 ∑^ i m i=1 x

1 i

∑m

i=1 x

2 i

∑m

i=1 x

3 ∑^ i m i=

x

2 i

m i=

x

3 i

m i=

x

4 i

b. What is the condition number of this matrix.

Answer:

||A||∞ = 44 and ||A|| 2 = 37.114.

||A

− 1 ||∞ = 0.62857 and ||A

− 1 || 2 = 0.5302.

K∞(A) = 27.657 and K 2 (A) = 19.678.

c. Use the Jacobi preconditioner, and compute the new condition number.

Answer:

A^ ˜ = D−^1 A

||A||∞ = 3 and ||A|| 2 = 2.46.

||A

− 1 ||∞ = 7.3 and ||A

− 1 || 2 = 5.98.

K∞(A) = 21.9 and K 2 (A) = 14.71.

d. Repeat with the Gauss-Seidel preconditioner.

Answer:

A^ ˜ = (D + L)−^1 A

||A||∞ = 3 and ||A|| 2 = 2.27.

||A

− 1 ||∞ = 5.86 and ||A

− 1 || 2 = 5.50.

K∞(A) = 17.6 and K 2 (A) = 12.5.

e. Show that the original curvature matrix is positive definite.

Answer:

One way is to show that all the principle submatrices have positive determinant:

The other way is to compute x

T Ax:

x

T Ax =

[

x 1 x 2 x 3

]

x 1

x 2

x 3

= 5 x

2 1 + 20x^1 x^3 + 34x

2 3 + 10x

2 2

= x

2 1 + (4x

2 1 + 20x^1 x^3 + 25x

2 3 ) + 9x

2 3 + 10x

2 2

= x

2 1 + (2x^1 + 5x^3 )

2

  • 9x

2 3 + 10x

2 2

f. Are the preconditioned matrices still positive definite?

Answer:

Jacobi:

Gauss-Seidel: