Tutorials › Regression Analysis (Undergraduate) › Comparing Candidate Forms Near Predictor Boundaries

Choosing and Explaining Nonlinear Forms · Tutorial 484 of 991

Comparing Candidate Forms Near Predictor Boundaries

Compare candidate nonlinear curves at the observed predictor boundaries by examining fitted values and local behavior in context.

Advanced 9 min read

What You'll Learn

  • Define predictor boundaries as the smallest and largest observed predictor values.
  • Compare candidate curves using fitted values at both boundaries on a common outcome scale.
  • Check nearby fitted changes and endpoint slopes for important differences in shape.
  • Calculate and interpret endpoint residuals without treating them as a complete model-selection rule.
  • Explain why similar interior fits can conceal sharply different boundary behavior.

Why Compare Curves at the Boundaries?

Two nonlinear curves can trace nearly the same path through the middle of the observed predictor values and still make quite different predictions near the smallest or largest observed value. These differences matter when a description or prediction concerns observations near an edge of the data. A plot dominated visually by the central observations may not make the contrast easy to see.

This tutorial focuses on comparing candidate curves within the observed predictor range, especially at its two ends. The aim is not to decide that one curve must be correct from an endpoint check alone. Instead, inspect what each candidate implies at the boundaries, compare those implications with the observed responses there, and report meaningful differences in context.

Definition: Let the observed predictor values range from \(x_{\min}\) to \(x_{\max}\), the smallest and largest values in the data. These are the predictor boundaries. A candidate fitted curve gives a fitted mean response \(\hat{f}(x)\) at each predictor value \(x\). Comparing candidate forms near the boundaries means examining their fitted values and local changes near \(x_{\min}\) and \(x_{\max}\), and, when useful, comparing those fitted values with observed responses there.

A Consistent Basis for Comparison

A candidate regression form represents the mean response as a function of the predictor. One general notation is \(E(Y_i\mid x_i)=f(x_i;\theta)\), where \(Y_i\) is the response for observation \(i\), \(x_i\) is its predictor value, and \(\theta\) denotes the parameters of the chosen form. After fitting, \(\hat{f}(x)\) is the fitted mean response at \(x\). For a descriptive comparison of fitted curves, we do not need to assume that errors have a particular probability distribution. We do need to compare curves fitted to the same data, for the same response and predictor, and on the same response scale.

The usual regression interpretation also relies on the model representing the conditional mean appropriately; in particular, the errors have mean zero conditional on the predictor. If a curve is used to describe expected response, its fitted values should be read as estimated mean responses, not as guarantees about individual outcomes. The boundary checks below are descriptive checks of candidate fits, not standalone hypothesis tests.

A useful comparison has several parts. First, calculate each curve’s fitted values at \(x_{\min}\) and \(x_{\max}\). Next, compare those values with the observations at or nearest to each boundary. Finally, inspect the curve’s change over a short interval next to each boundary. If derivatives are available, the derivative gives the curve’s instantaneous slope; otherwise, a finite difference over a specified interval gives an interpretable average change. Always retain the predictor and response units.

Key principle: Compare boundary behavior on a common scale and in context. A curve’s endpoint fitted value describes its fitted mean at that observed predictor value; a slope describes how its fitted mean changes locally. Neither quantity alone establishes that the curve is the best overall form.

Worked Example: Nearly Identical Interior Fits, Different Endpoint Fits

Suppose two hypothetical candidate curves were fitted to the same data, with \(x\) measured in a specified predictor unit and \(Y\) measured in outcome units. The observed predictor range is from 0 to 10. Define the rescaled predictor \(z=(x-5)/5\), so the endpoints correspond to \(z=-1\) and \(z=1\). The fitted curves are

$$ \hat{f}_Q(x)=50+8z-4z^2,\qquad \hat{f}_C(x)=50+8z-4z^2+8z^3. $$

Both curves give 50 outcome units at the midpoint, \(x=5\), where \(z=0\). At \(x=4\), \(z=-0.2\). Substitution gives

$$ \hat{f}_Q(4)=50+8(-0.2)-4(-0.2)^2=50-1.6-0.16=48.24, $$
$$ \hat{f}_C(4)=48.24+8(-0.2)^3=48.24-0.064=48.176. $$

The two fitted values differ by only 0.064 outcome units at \(x=4\). At \(x=6\), where \(z=0.2\), the corresponding calculations are

$$ \hat{f}_Q(6)=50+8(0.2)-4(0.2)^2=50+1.6-0.16=51.44, $$
$$ \hat{f}_C(6)=51.44+8(0.2)^3=51.44+0.064=51.504. $$

Again, the difference is 0.064 outcome units. At the boundaries, however, \(z=-1\) and \(z=1\). Thus

$$ \begin{aligned} \hat{f}_Q(0)&=50+8(-1)-4(-1)^2=38,\\ \hat{f}_C(0)&=38+8(-1)^3=30,\\ \hat{f}_Q(10)&=50+8(1)-4(1)^2=54,\\ \hat{f}_C(10)&=54+8(1)^3=62. \end{aligned} $$

The fitted curves are very close at \(x=4\) and \(x=6\), but differ by 8 outcome units at each boundary. A fair report therefore would not say that the two forms behave similarly across the whole observed range. It would say that their fitted values are close at the illustrated interior points but substantially different at the observed endpoints. Whether 8 outcome units is important depends on the outcome’s context and scale.

Why Small Interior Differences Can Grow at an Edge

The preceding example has a short algebraic explanation. The difference between the two fitted curves is exactly the cubic term:

$$ \hat{f}_C(x)-\hat{f}_Q(x)=8z^3. $$

When \(z=0\), this difference is zero. For \(|z|\leq 0.2\), its absolute value is at most \(8(0.2)^3=0.064\). But at either boundary, \(|z|=1\), so the absolute difference is \(8(1)^3=8\). The same term that barely changes the fitted curve near the center can have a much larger effect at the edges.

The slopes also differ. Since \(z=(x-5)/5\), \(dz/dx=1/5\). Differentiating each fitted curve with respect to \(x\) gives

$$ \frac{d\hat{f}_Q}{dx}=\frac{8-8z}{5},\qquad \frac{d\hat{f}_C}{dx}=\frac{8-8z+24z^2}{5}. $$

At the largest observed predictor value, \(z=1\). The quadratic slope is \((8-8)/5=0\) outcome units per predictor unit, whereas the cubic slope is \((8-8+24)/5=4.8\) outcome units per predictor unit. Thus the fitted values at the upper boundary differ, and the curves imply quite different local behavior there. The derivative calculation describes the fitted curves at the boundary; it does not establish what happens beyond the observed range.

Compare Fitted Values With Boundary Observations

A boundary comparison is more informative when it includes the observed response values. For an observation \(i\), the residual is \(e_i=y_i-\hat{f}(x_i)\): the observed response minus the fitted response. A positive residual means the curve underpredicts that observed response; a negative residual means it overpredicts. Comparing endpoint residuals shows how closely each candidate fits those particular observations, but it does not summarize its fit over all observations.

Worked Example: Checking Endpoint Residuals

Use the two hypothetical curves from the previous example. Suppose the observed response is 37 outcome units at \(x=0\) and 63 outcome units at \(x=10\). These values and the fitted curves are hypothetical. At \(x=0\), the fitted values are 38 for the quadratic and 30 for the cubic. The endpoint residuals are

$$ e_Q=37-38=-1,\qquad e_C=37-30=7. $$

Thus, at the smallest observed predictor value, the quadratic overpredicts the response by 1 outcome unit, while the cubic underpredicts it by 7 outcome units. At \(x=10\), the fitted values are 54 and 62, so

$$ e_Q=63-54=9,\qquad e_C=63-62=1. $$

At the largest observed predictor value, the quadratic underpredicts by 9 outcome units and the cubic underpredicts by 1 outcome unit. In this pair of endpoint observations, the cubic is closer at the upper boundary and the quadratic is closer at the lower boundary. That mixed result does not support choosing one curve solely from these two residuals. The full data, the intended use of the curve, and the other comparison criteria remain relevant.

The comparison also depends on which observations actually occur at an endpoint. If several observations share the smallest or largest predictor value, examine their responses rather than treating one response as representative of all of them. If there is no observation at a particular exact value because predictor values are continuous, the minimum and maximum observed values are still the boundaries: evaluate the fitted curves at those observed predictor values and compare them with the corresponding observations.

Inspect Changes Just Inside Each Boundary

Endpoint fitted values do not tell the whole story. Two curves can pass close to the same endpoint value but approach it at different rates. A practical check is to calculate each fitted curve’s change over a short interval that remains inside the observed range. Divide the change in fitted response by the change in predictor to express an average slope over that interval. State the interval, since a nonlinear curve’s average slope can depend on the interval selected.

Worked Example: Comparing the Upper-Edge Change

Return to the two curves, with \(x_{\max}=10\). Compare their fitted values at \(x=9.5\) and \(x=10\); both values lie within the observed predictor range. At \(x=9.5\), \(z=(9.5-5)/5=0.9\). The quadratic fitted value is

$$ \hat{f}_Q(9.5)=50+8(0.9)-4(0.9)^2=50+7.2-3.24=53.96. $$

The cubic fitted value adds \(8(0.9)^3=8(0.729)=5.832\), giving

$$ \hat{f}_C(9.5)=53.96+5.832=59.792. $$

At \(x=10\), the fitted values are 54 and 62. The average changes from \(x=9.5\) to \(x=10\), per predictor unit, are therefore

$$ \frac{54-53.96}{10-9.5}=\frac{0.04}{0.5}=0.08 \quad\text{and}\quad \frac{62-59.792}{10-9.5}=\frac{2.208}{0.5}=4.416. $$

Over this final half-unit of the predictor, the quadratic’s fitted mean increases by an average of 0.08 outcome units per predictor unit, while the cubic’s increases by 4.416. This calculation shows an important difference in fitted behavior just inside the upper boundary; it does not extend either curve beyond \(x=10\).

Using Boundary Checks Responsibly

Boundary comparisons help explain why candidate forms that look similar overall may not be interchangeable for a particular purpose. If predictions near the maximum predictor value are important, for example, a large difference between fitted values there deserves explicit attention. The same is true at the minimum. If boundary predictions are not the focus, the difference can still help characterize the curve, but it should not be presented as decisive without considering the rest of the evidence.

Keep these checks disciplined:

  • Use the same observed predictor range and response scale for every candidate being compared.
  • Report endpoint fitted values with units and, where useful, the observed responses and residuals.
  • When comparing local change, state the boundary-adjacent interval or the slope’s units.
  • Describe differences as features of the fitted curves, not proof that one curve is the true relationship.
  • Do not interpret behavior outside \(x_{\min}\) and \(x_{\max}\) as observed boundary behavior; values outside that range are beyond the data.

A common mistake is to look at nearly overlapping curves in the center and conclude that the candidate forms must give similar predictions throughout the range. The reasoning fails because terms such as \(z^3\) can be tiny when \(z\) is near zero but much larger when \(|z|\) approaches one. The correction is to calculate and compare fitted values at both observed boundaries and inspect nearby changes, then describe any discrepancy in the units and context of the response.

Key takeaway: Similar interior fits do not guarantee similar fitted means at the smallest and largest observed predictor values. Boundary values, boundary-adjacent changes, and the responses actually observed there reveal what each candidate curve implies at the edges of the data.

Check Your Understanding

Answer each question using the definitions and calculations in this tutorial.

  1. What are the predictor boundaries, and why should candidate curves be evaluated at both of them?
  2. Two fitted curves differ by \(5z^3\), where \(z=0\) at the center and \(z=1\) at the upper boundary. Find their fitted-value difference at those two locations and explain the contrast.
  3. An observation has response 24 units and a candidate fitted value of 27 units. Calculate the residual and interpret its sign in context.
  4. Why is it useful to compare fitted changes over a short interval just inside a boundary, in addition to comparing fitted values at the boundary?
  5. Two forms give similar fitted values near the center but differ by 6 outcome units at the largest observed predictor value. What can be concluded, and what cannot be concluded, from that comparison alone?