Should we interpolate the data, fit a model, or reject the question?
Same data, different questions:
MATLAB stores polynomial coefficients from highest power to constant term.
This means:
These are different polynomials.
poly moves from roots to coefficients. roots moves back.
Coefficient vectors can be multiplied, divided, and differentiated.
When is a curve a model rather than just a drawing through points?
Before fitting, plot the data.
The degree is a modeling choice.
Residuals show what the model missed.
RMSE is useful, but it does not replace the residual plot.
A higher-degree polynomial can follow the data more closely and still be a worse model.
Ask:
What question are we actually answering between or beyond measured points?
Interpolation estimates values between observed points.
It should respect the measured data, but it does not explain the mechanism.
The query point should be inside the measured range unless extrapolation is intentional.
Interpolation has assumptions before it has an answer.
Common interp1 methods:
"nearest""linear""pchip""spline"The smoother curve is not automatically the better answer.
Curve fitting estimates a simpler relationship from noisy data.
The fitted curve is a claim about a pattern, not a copy of the data.
Use interpolation when the measured values are trusted and the question is between them.
Use fitting when the data are noisy and the question is about a trend.
Extrapolation is a separate claim.
It needs a reason beyond the code running without an error.
What is the hidden claim?
Does the generated solution explain the difference between interpolation and fitting?
Does it check residuals, degree choice, and extrapolation risk?
For a new data set, what would make you choose:
MATH 346