NUMERICAL METHODS PROBLEM SET 9
PS9-1 Statistics
Given the data
determine (a) the mean, (b) the standard deviation, (c)
the variance, (d) the coefficient of
variation .
PS9-2 Least- Square Regression
Suppose you want to fit a quadratic curve ( parabola ) to the following data
points using least
square regression .
(1) What is the function Sr to be minimized to find the
least square regression curve?
(2) What are the three conditions to find the coefficients of the quadratic
curve of the least
square regression? Write the matrix equation of the three conditions.
PS9-3
Two Dimensional Quadratic Regression
Read and understand section 17.3 of the textbook. The mathematical background of
this
programming assignment is very similar to the one in section 17.3.
The goal of two dimensional quadratic regression is to find the “best” values of
the coefficients
of a quadratic function y of x1 and x2
The coefficients , and
can be
determined such that they define a function y
that minimizes the sum of the squares of the errors, or residuals,
Differentiation of S r with respect to each of the unknown
coefficients, , and
, gives six linear algebraic equations , or a 6 x 6 matrix equation,
[M]{a}={b}, similar to
equation (17.22) on p.461 of the textbook.
(1) Derive the matrix equation [M]{a}={b} for two-dimensional quadrilateral
regression. Show
all the derivation process.
(2) Given the following data points write a program for finding coefficients
, and of the quadratic regression function.
To show that your program is properly implemented, your
program has to generate: (1) a text
file, output.txt, that contains the 6 x 6 matrix [M], and values of coefficients
, and ; and (2) a VRML file, output.wrl, that
illustrates the data
points and the quadratic regression surface.
Your VRML file should look something like Figure 1. To minimize your work to
generate
the VRML output the following subroutines and a sample code are provided.
In your hand-in directory on AFS, make a new directory
called ps9 (in lower case ) and hand
in the following in the directory. Don’t copy object files (*.obj, *.o).
• Source code files and header file
• Executable file
• Text file name output.txt
• Output VRML file named output.wrl.
Also hand in a printout of the following:
• Source code files and header files
• Text file, ourput.txt
• Two images of the VRML files that look like Figure 1.
PS9-1 (20 pts) |
PS9-2 (20 pts) |
PS9-3a (30 pts) For handing in all the files and printouts (code and wrl files) |
PS9-3b (30 pts) For the correct method and the results |
Total (100 pts) |
Prev | Next |