Linear regression prediction
Fit y = intercept + slope × x and predict a value.
How this works
Ordinary least squares minimizes vertical squared residuals.
Example
Using the example inputs, predicted y is 8.
- X values
- 1, 2, 3
- Y values
- 2, 4, 6
- Predict at x
- 4
- Predicted y
- 8
Scope and assumptions
Predictions are descriptive, not guaranteed; extrapolation outside the observed range is risky.
NIST statistical methods handbook