Numerical Computing :: Project Nine

$24.99 $18.99

1. Consider the function f(x) = sin(2πx) + cos(3πx), x ∈ [−1, 1]. (1) Evaluate the function values at n evenly spaced points. You get to choose n. For d from 0 to n − 1, compute the least-squares coefficients of a polynomial of degree d with the same training data using both the QR…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:

Description

5/5 – (2 votes)

1. Consider the function

f(x) = sin(2πx) + cos(3πx), x [−1, 1].

(1)

Evaluate the function values at n evenly spaced points. You get to choose n. For d from 0 to n − 1, compute the least-squares coefficients of a polynomial of degree d with the same training data using both the QR method and the normal equations.

  1. For each trained polynomial compute testing error on a set of testing data, which you will generate. Plot the error ed versus d on a semil-ogy scale. Make sure to include both (i) the error computed using the QR decomposition and (ii) the error computed using the normal equa-tions. Interpret the error behavior. (HINT: It’s related to the condition number of the matrix in the least-squares problem.)

1

Numerical Computing :: Project Nine
$24.99 $18.99