Cubic Regression Calculator
Enter the x and y values of your points to fit a cubic.
Numbers separated by commas.
The same number of numbers as the x values.
Try
Result
You entered
R²
Show the work
Least-squares cubic fit
Choose a, b, c and d to make the sum of the squared vertical gaps between the points and the curve as small as possible. Setting each partial derivative to zero gives four linear equations, the normal equations.
Using
Sums for the normal equations
With n = 5 points, in exact fractions.
Solving the normal equations
Elimination in exact fractions gives the four coefficients.
Coefficient of determination
R² is the share of the spread in y that the cubic explains; 1 means every point is on the curve.
Result
The best cubic fit.