- (6 points) Find the Vandermonde form, the Lagrange form, and the Newton form of the interpolating polynomial for these data
x | -2 | 0 | 1 | 2 |
y | 2 | 4 | 2 | 2 |
- (Programming by MATLAB) The US census data from 1900 to 2000 are as follows (numbers are in million):
x | 1900 | 1910 | 1920 | 1930 | 1940 | 1950 | 1960 |
y | 75.995 | 91.972 | 105.711 | 123.203 | 131.669 | 150.697 | 179.323 |
1970 | 1980 | 1990 | 2000 | ||||
203.212 | 226.505 | 249.633 | 281.422 |
- (8 points) Spline interpolation
- Find the natural cubic spline function S to interpolate the data.ii. Find the population estimate for 1985 by the spline function
iii. Find the population estimate for 2010 by the spline function.
You do not need to write an explicit expression for S(x). Just plot y = S(x), the given 10 data points, and the 2 points of the population estimates on the same graph. Print your MATLAB codes.
Note: For reference, see us_census.m on the course website: https://www.cs.mcgill.ca/chang/teaching/cs350/doc.php
- (6 points) LS approximation
- Find the straight line which best fits the data in the least-squares sense.
- Find the population estimate for 1985 by this straight line.iii. Find the population estimate for 2010 by this straight line.
Plot the straight line, the given 11 data points, and the 2 points of the population estimates on the same graph. Print your MATLAB codes.
Note: You are not allowed to use MATLAB built-in functions polyfit, polyval, and spline.
Reviews
There are no reviews yet.