Advertisement

Cubic regression calculator

Enter matching predictor and response lists to fit the model and predict at a chosen x value.

Calculator

Predicted response
27.000000
R squared
1.000000
Residual sum of squares
0.000000
Residual degrees of freedom
1.000000
Residual standard deviation
0.000000
Coefficients in original x units
CoefficientEstimate
b00.000000
b10.000000
b20.000000
b31.000000
Fitted observations
xObserved yPredicted yResidual
-2.000000-8.000000-8.0000000.000000
-1.000000-1.000000-1.0000000.000000
0.0000000.0000000.000000-0.000000
1.0000001.0000001.0000000.000000
2.0000008.0000008.0000000.000000

Advertisement

How this calculator works

Fit a third-degree polynomial including all lower powers and an intercept. A cubic can describe a change in curvature, but extra flexibility can fit noise. At least four distinct predictor values are required. Residual standard deviation uses n - 4 degrees of freedom; an exactly determined fit has no such variance estimate.

Formula

ŷ = b0 + b1x + b2x² + b3x³; minimise Σ(y - ŷ)².

Worked example

Points at x = -2, -1, 0, 1, 2 with y = -8, -1, 0, 1, 8 fit y = x³. The prediction at x = 3 is 27.

Advertisement

Frequently asked questions

Can a cubic have two turning points?

Yes, depending on the coefficients of its derivative. It can also be monotonic.

Why keep the lower powers?

A full cubic model includes intercept, linear and quadratic terms. Dropping them imposes additional constraints.

Is cubic extrapolation reliable?

High powers can grow quickly outside the observed range. A good fit within the data is not evidence for distant predictions.

Sources

Advertisement