Question: PLEASE INCLUDE COMMENTS A. Write two python functions. The first should implement the function: The second should take a set of exact data points, ,
PLEASE INCLUDE COMMENTS
A.
Write two python functions. The first should implement the function:
The second should take a set of exact data points, , and a set of interpolated data points , and compute the root mean square error by:
B.
Write a python program that uses the above functions to interpolate between the values of sampled uniformly at points in the interval .
Create a series of plots below where you compare the points to the following:
-
The function computed with the above function.
-
Nearest neighbor interpolation
-
Linear interpolation
-
Cubic spline interpolation
-
Lagrange polynomial interpolation.
For each of these, compute estimated data points using a uniform spacing of over the range . Be sure to use appropriate symbols and legends to identify different curves/points use multiple plots as needed for clarity. For each interpolation use the function you wrote above to compute the RMSE.
C
Repeat part B, but sample with and uniformly distributed points.
D.
In table form, compare the RMSEs for the different interpolation mechanisms with and data points. Comment on the results. Which curves look the best representing the function ? Does this change as you change the number of data points?
PLEASE INCLUDE COMMENTS
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
