Quiz: Interpolation and Regression
1. Given the following data:
x, y 0, 2 1, 1
What is the predicted y value with a linear interpolation of the data at x=0.5?
A. 0.25
- Incorrect.
B. 0.5
- Incorrect.
C. 1.5
- Correct.
D. 2.0
- Incorrect.
2. What is a module for nonlinear regression in Python?
A. numpy.polyfit
- Incorrect. The polyfit function creates a polynomial regression of data.
B. scipy.optimize.curve_fit
- Correct. Scipy.optimize package has a minimize and curve_fit function for nonlinear regression. Gekko is another Python package for optimization and regression.
C. numpy.optimize
- Incorrect. Numpy does not have an optimization function.
3. What is a Python function that can find solutions to nonlinear equations?
A. matplotlib.fsolve
- Incorrect. This package is used to create plots.
B. numpy.optimize.fsolve
- Incorrect. Numpy is a base numerical Python package for other packages such as Scipy.
C. scipy.optimize.fsolve
- Correct.