Homework Assignment #8

(Due: Wednesday, June 8 in class)

No late homeworks this time !!

Theory Part

Problem 1 (40%):
Consider a set of data points {(xi,yi)|i=1,2, .... ,m}.

a) Show that the conditions that need to be satisfied if you want to do a discrete least square approximation to the function
y = b*x^a
does not lead to exlicit solutions for a and b.

b) However, one can fit instead ln(y) to
ln(y) = ln(b) + a*ln(x)
Write down the normal equations, and the explicit expressions for a and ln(b).

Numerics Part

Problem 2 (60%):
Consider the following data set: {(xi,yi)} = {(4.0,102.56),(4.2,113.18), (4.5,130.11),(4.7,142.05),(5.1,167.53),(5.5,195.14),(5.9,224.87),(6.3,256.73),(6.8,299.5),(7.1,326.72)}

a) Construct the least square polynomial of degree one (straight line fit) and compute the error.
b) Construct the least square polynomial of degree two and compute the error.
c) Construct the least square approximation of the form b*exp(a*x) and compute the error.
d) Construct the least square approximation of the form b*x^a and compute the error.
e) What form of relationship between the data do you think holds ?
Hints: For parts a), c), and d), you could either use an iterative scheme to find the 2 constants, or use the analytic expressions. For part b), the analytic expression is very messy. I recommend an iterative scheme. I used Gauss-Seidel with tolerance = 0.0001, and initial guesses for a0=a1=a2=0. You might want to take a look at (and just modify) the code that has been posted on the class webpage.