What metrics should I use to compare two different curve fitting methods?
Conditions
- Two or more curve fitting models are being evaluated.
- The models are fitted to the same dataset.
Reasoning, step by step
- Calculate R-squared for each model to assess goodness of fit.
- Calculate Adjusted R-squared to account for the number of predictors.
- Calculate RMSE to measure the average error magnitude.
- Calculate SSE to measure the total error.
- Compare the values across models to determine which performs better or if they are equivalent.
Example
The comparison table displays the column headers 'R_squared', 'RMSE', and 'SSE' with values 0.98962, , and for both the Fitnlm approach and the Optimization approach. The speaker concludes, "As we can see, the two models are quite similar, and either functionality is usable depending on the requirements and the problem to solve."
Common misconceptions
- Relying solely on R-squared without considering error metrics like RMSE or SSE.
- Assuming a high R-squared guarantees the model is physically meaningful or free from overfitting without checking other diagnostics.
Watch the explanation
Connected concepts
Explore next
Related questions
A sigmoidal curve is chosen because the physical mechanism of a wind turbine dictates that power output does not increase linearly with wind speed. A minimum wind speed is required to start the blades rotating, and at higher speeds, the generator reaches its maximum electrical output.
Conditions: The relationship between wind speed and power output is being modeled.; The physical constraints of the wind turbine (minimum cut-in speed and maximum rated power) are considered.
In the bivariate formulation, interpolation requires the fitted function to match the measured values exactly at every given data point, expressed as . Approximation relaxes this exact fitting by allowing a deviation or error term , expressed as .
Conditions: Given m points with .; Find a function .; Interpolation requires exact matching at the sample points.; Approximation allows an error term .
Interpolation is said to have no unique solution because, given only the requirement that a function pass through the data points, there exist infinitely many different functions that can satisfy this exact condition. The difficulty of the problem lies not in the existence of an interpolant, but in selecting among the many valid functions.
Conditions: A finite set of data points is given.; No extra constraints beyond passage through the points are imposed.
In the MATLAB Curve Fitter app, you select the predictor variable for the x-axis and the response variable for the y-axis. For the wind turbine example, wind speed is selected as the independent variable (predictor) on the x-axis, and power output is selected as the dependent variable (response) on the y-axis.
Conditions: The data are available in MATLAB.; The user wants to visualize and fit a relationship between two specific variables.
You can force your curve fit to respect physical limits by formulating it as a constrained optimization problem using the Optimization Toolbox. Define the model coefficients as optimization variables and assign specific lower and upper bounds to each coefficient.
Conditions: Requires an optimization solver like lsqnonlin.; Objective function must be defined based on the model equation (e.g., minimizing sum of squared errors).; Physical or mathematical constraints on coefficients are known.
Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.