Tutorials › Regression Analysis (Undergraduate) › Calibration Intercept and Slope

Prediction Metrics and Calibration · Tutorial 785 of 991

Calibration Intercept and Slope

Use the calibration intercept and slope to distinguish a systematic shift in predictions from predictions that are too extreme or not extreme enough.

Intermediate 10 min read

What You'll Learn

  • Define the calibration regression of observed outcomes on predicted values.
  • Identify the ideal intercept and slope and explain their units.
  • Interpret a positive or negative intercept when the slope is near one.
  • Explain what slopes above and below one indicate across the prediction range.
  • Calculate calibration intercepts and slopes from hypothetical paired data.
  • Recognize why an intercept alone does not describe all calibration bias.

Why Separate Intercept and Slope?

A set of predictions can miss observed outcomes in different ways. Predictions might be consistently too low by about the same amount, or they might be too low for high-outcome cases and too high for low-outcome cases. Looking at a single average error can obscure this difference. A calibration regression summarizes how observed outcomes vary with predicted values, using an intercept and a slope to describe these two broad patterns.

Here, \(y_i\) denotes the observed outcome for case \(i\), and \(\hat y_i\) denotes its predicted outcome. The predictions should be evaluated on cases for which the observed outcomes were not used to fit the prediction model, when the goal is to assess performance on new cases. The calibration regression is a diagnostic summary; it does not by itself establish that changing the prediction model will improve predictions.

Definition: The calibration regression is the ordinary least-squares regression of observed outcomes \(y_i\) on predicted values \(\hat y_i\): $$ y_i = \alpha_{\mathrm{cal}} + \beta_{\mathrm{cal}}\hat y_i + \varepsilon_i. $$ The estimated intercept is \(a_{\mathrm{cal}}\), and the estimated slope is \(b_{\mathrm{cal}}\). Perfect calibration in this linear summary corresponds to intercept \(0\) and slope \(1\), so the fitted relationship is \(y_i=\hat y_i\).

The observed and predicted outcomes must refer to the same cases and use the same outcome scale. For example, if the outcome is measured in hours, both observed and predicted values must be in hours. The calibration intercept is measured in outcome units. The slope is the change in the fitted observed outcome for a one-unit increase in the predicted outcome; when both are on the same scale, the slope is unitless.

What the Intercept and Slope Mean

The intercept describes the fitted observed outcome when the predicted value is zero. If zero is outside the range of the predictions, that particular interpretation may be an extrapolation and may not be practically useful. The slope describes how quickly the fitted observed outcome changes as predictions increase.

The reference line for perfect calibration is \(y=\hat y\). Comparing the calibration line with that reference is more informative than interpreting either coefficient in isolation. For a predicted value \(x\), the difference between the calibration line and the perfect-calibration line is

$$ (a_{\mathrm{cal}}+b_{\mathrm{cal}}x)-x = a_{\mathrm{cal}}+(b_{\mathrm{cal}}-1)x. $$

A positive difference means the fitted observed outcome is higher than the prediction, so the prediction is low relative to the fitted calibration relationship. A negative difference means the fitted observed outcome is lower than the prediction. The difference can vary with \(x\), which is why a slope departure from one matters.

Calibration resultUsual interpretationImportant qualification
Intercept positive, slope near oneObserved outcomes tend to be higher than predictions by a roughly constant amount.The shift interpretation is clearest when the slope is indeed close to one.
Intercept negative, slope near oneObserved outcomes tend to be lower than predictions by a roughly constant amount.The intercept is the fitted difference at a prediction of zero.
Slope above oneObserved outcomes change more per prediction unit than the predictions do; predictions tend to be too moderate around the data’s center.Compare fitted outcomes with predictions over the observed prediction range.
Slope below oneObserved outcomes change less per prediction unit; predictions tend to be too extreme around the data’s center.The direction of the difference also depends on the intercept.

The phrases “too moderate” and “too extreme” describe the pattern relative to the center of the observed predictions, not a universal direction for every case. For a fitted calibration line, the average fitted outcome equals the average observed outcome. Thus, when the slope exceeds one, the line is steeper than the ideal line and typically lies below it for predictions below the center and above it for predictions above the center. When the slope is below one, the pattern is typically reversed. A nonzero intercept can shift where the two lines cross, so check the fitted difference \(a_{\mathrm{cal}}+(b_{\mathrm{cal}}-1)x\) at relevant prediction values.

Calculating the Calibration Line

For paired data \((\hat y_i,y_i)\), the least-squares slope is the sample covariance of predictions and observed outcomes divided by the sum of squared prediction deviations. The intercept is chosen so the fitted line passes through the point formed by the two sample means.

$$ b_{\mathrm{cal}} = \frac{\sum_{i=1}^{n}(\hat y_i-\bar{\hat y})(y_i-\bar y)} {\sum_{i=1}^{n}(\hat y_i-\bar{\hat y})^2}, \qquad a_{\mathrm{cal}}=\bar y-b_{\mathrm{cal}}\bar{\hat y}. $$

The denominator must be positive: there must be variation in the predicted values. These formulas produce a descriptive least-squares line. If the purpose is only to summarize the observed pairs, the calculations do not require a normal-error assumption. Statistical inference about a population calibration line needs additional assumptions, such as independent cases and an appropriate model for the conditional mean; standard small-sample \(t\)-based inference also uses normally distributed errors. The examples below interpret fitted summaries and make no population inference.

Why the Least-Squares Line Passes Through the Means

A short derivation explains the role of the intercept. Write \(x_i=\hat y_i\), and consider the sum of squared vertical differences \(Q(a,b)=\sum_{i=1}^{n}(y_i-a-bx_i)^2\). At its minimum, differentiating with respect to \(a\) gives

$$ \frac{\partial Q}{\partial a} =-2\sum_{i=1}^{n}(y_i-a-bx_i)=0, \qquad a=\bar y-b\bar x. $$

Substituting this expression for \(a\) into the residuals gives \((y_i-\bar y)-b(x_i-\bar x)\). Minimizing the sum of their squares with respect to \(b\) yields

$$ \frac{\partial Q}{\partial b} =-2\sum_{i=1}^{n}(x_i-\bar x)\big[(y_i-\bar y)-b(x_i-\bar x)\big]=0, $$ $$ b = \frac{\sum_{i=1}^{n}(x_i-\bar x)(y_i-\bar y)} {\sum_{i=1}^{n}(x_i-\bar x)^2}. $$

Since \(a+b\bar x=\bar y\), the fitted line passes through \((\bar x,\bar y)\), or, in the original notation, through \((\bar{\hat y},\bar y)\). This also shows why the intercept by itself is not generally the average prediction error: the average fitted difference at the mean predicted value is \(\bar y-\bar{\hat y}\), which can depend on both the intercept and the slope.

Worked Example: A Constant Upward Shift

Suppose three independent hypothetical cases have predictions and observed outcomes, both measured in hours:

CasePredicted hours, \(\hat y_i\)Observed hours, \(y_i\)
11013
22023
33033

The pairs are on the same scale, and the predictions vary. In this constructed example, the observed outcome is exactly three hours greater than the prediction for every case, so a straight-line calibration summary is appropriate. The means are \(\bar{\hat y}=20\) hours and \(\bar y=23\) hours. The slope calculation is

$$ b_{\mathrm{cal}} = \frac{(-10)(-10)+(0)(0)+(10)(10)} {(-10)^2+0^2+10^2} = \frac{200}{200} =1. $$

The intercept is

$$ a_{\mathrm{cal}}=23-(1)(20)=3\text{ hours}. $$

Thus the calibration line is \(y=3+\hat y\). Its slope matches the ideal slope, while its positive intercept indicates a constant upward shift in observed outcomes relative to predictions: in these hypothetical data, predictions are three hours too low throughout the listed range. Because the slope is one, the fitted difference from the ideal line is three hours at every prediction value.

Worked Example: A Slope Above One

Now consider predictions and observed outcomes, both in points, for three independent hypothetical cases:

CasePredicted points, \(\hat y_i\)Observed points, \(y_i\)
11012
22024
33036

The predictions vary, the paired values use the same scale, and the points in this hypothetical example follow an exact straight-line relationship. The means are \(\bar{\hat y}=20\) and \(\bar y=24\). The slope and intercept are

$$ b_{\mathrm{cal}} = \frac{(-10)(-12)+(0)(0)+(10)(12)} {(-10)^2+0^2+10^2} = \frac{240}{200} =1.2, $$ $$ a_{\mathrm{cal}}=24-(1.2)(20)=0. $$

The fitted line is \(y=1.2\hat y\). At a prediction of 10 points, it gives a fitted observed outcome of 12 points, which is 2 points above the prediction. At a prediction of 30 points, it gives 36 points, 6 points above the prediction. Here predictions are too low across the displayed range, but that is not a consequence of a slope above one alone: it follows from this example’s zero intercept and particular prediction range. More generally, a slope above one means the fitted observed outcomes increase faster than predictions do, and the comparison with the ideal line depends on both coefficients and the prediction value.

Worked Example: A Slope Below One

For a third hypothetical set of independent cases, predictions and observed outcomes are measured in points:

CasePredicted points, \(\hat y_i\)Observed points, \(y_i\)
11014
22020
33026

The values are paired on the same scale, the predictions vary, and the constructed points lie exactly on a straight line. Both means equal 20 points. The slope is

$$ b_{\mathrm{cal}} = \frac{(-10)(-6)+(0)(0)+(10)(6)} {(-10)^2+0^2+10^2} = \frac{120}{200} =0.6. $$

The intercept is \(a_{\mathrm{cal}}=20-(0.6)(20)=8\) points, so the calibration line is \(y=8+0.6\hat y\). At a prediction of 10 points, the fitted observed outcome is 14 points, 4 points higher than predicted. At a prediction of 30 points, the fitted observed outcome is 26 points, 4 points lower than predicted. In this example, predictions are too extreme around the center: the low prediction is too low, while the high prediction is too high. That pattern is consistent with the slope being below one, but the intercept and the prediction range still matter when assessing any particular value.

Common Mistakes and Practical Limits

  • Calling a positive intercept “the average overprediction” or “the average underprediction” in every case. The intercept is the fitted observed outcome at predicted value zero. If the slope differs from one, the fitted difference from predictions changes with the predicted value.
  • Interpreting a slope above one as meaning every prediction is too low. The slope describes the rate of change. To determine whether the fitted observed outcome is above or below a prediction at a particular value, calculate \(a_{\mathrm{cal}}+(b_{\mathrm{cal}}-1)\hat y\).
  • Assuming an ideal intercept and slope prove every prediction is accurate. A fitted line can match the ideal line while individual cases still have substantial prediction errors. Calibration coefficients summarize a relationship; they do not describe every miss.
  • Giving the intercept a practical meaning when predicted zero is far outside the data range. In that situation, interpreting the fitted value at zero extrapolates beyond observed predictions. Focus on fitted comparisons over the range actually evaluated.

Calibration coefficients depend on the cases and prediction range being examined. A line fitted to one group or one set of cases need not summarize another group or future cases. They are useful alongside other measures of prediction performance, but neither coefficient alone captures the full size or pattern of individual errors.

Key takeaway: The ideal calibration intercept and slope are \(0\) and \(1\). An intercept departure can indicate a shift, while a slope departure indicates that observed outcomes change at a different rate than predictions. Interpret the fitted difference \(a_{\mathrm{cal}}+(b_{\mathrm{cal}}-1)\hat y\) over the relevant prediction range rather than reading either coefficient in isolation.

Check Your Understanding

Try these questions without looking back.

  1. What are the ideal values of the calibration intercept and slope, and what does the corresponding fitted line represent?
  2. A calibration line has intercept 5 outcome units and slope 1. What pattern does this suggest, and what is the fitted difference from prediction?
  3. A calibration slope is 0.7. Explain what this says about the rate of change in fitted observed outcomes and why the intercept still matters.
  4. If predictions and observed outcomes have means of 18 and 21, respectively, and the fitted slope is 1.1, calculate the fitted intercept.
  5. Why can a calibration intercept be difficult to interpret when predicted value zero is far outside the observed prediction range?