Tutorials › Regression Analysis (Undergraduate) › Uncertainty in Quadratic Slopes and Turning Points

Polynomial Regression · Tutorial 430 of 991

Uncertainty in Quadratic Slopes and Turning Points

Calculate confidence intervals for slopes along a quadratic curve and use coefficient uncertainty to assess how precisely its turning point is estimated.

Intermediate 10 min read

What You'll Learn

  • Write the estimated slope of a quadratic regression at a specified predictor value.
  • Calculate its standard error using both coefficient variances and their covariance.
  • Construct and interpret a confidence interval for a quadratic slope.
  • Use the delta method to approximate uncertainty in an estimated vertex.
  • Recognize when a vertex estimate is unstable and its interval may be unreliable.

Why Uncertainty Depends on Where You Measure the Slope

A quadratic regression curve does not have one slope: its slope changes with the predictor value. A fitted curve may rise at one value, flatten near a turning point, and fall at another. Consequently, an uncertainty statement about its slope must name the predictor value. The uncertainty in the estimated slope also depends on how precisely both polynomial coefficients have been estimated and on how those estimates vary together.

A related question concerns the estimated turning point, or vertex. The vertex is calculated from a ratio of two fitted coefficients. Uncertainty in either coefficient can therefore affect its estimated location, sometimes substantially. This tutorial develops confidence intervals for slopes and a first-order approximation for uncertainty in the vertex.

Model and Assumptions

For observations \((x_i,Y_i)\), consider the quadratic regression model

$$ Y_i=\beta_0+\beta_1x_i+\beta_2x_i^2+\varepsilon_i,\qquad i=1,\ldots,n. $$

Here \(\beta_0,\beta_1,\beta_2\) are unknown coefficients, and \(\varepsilon_i\) is the error for observation \(i\). For the exact confidence interval for a slope developed below, assume the predictor values are fixed (or condition on their observed values), the quadratic mean model is appropriate, the errors are independent with mean zero and common variance \(\sigma^2\), and the errors are normally distributed. The three columns \(1,x,x^2\) must provide enough independent information to estimate all three coefficients. In practice, residual plots and knowledge of how the data were collected help assess whether these assumptions are reasonable.

Write the fitted coefficients as \(b_0,b_1,b_2\). The residual mean square is \(s^2\), and \(s\) estimates the error standard deviation. The coefficient estimates have estimated variances and covariances; these are often reported in a covariance matrix. The covariance matters because the estimates of \(b_1\) and \(b_2\) generally are not independent.

Definition: The fitted slope of the quadratic mean curve at predictor value \(x_0\) is \(b_1+2b_2x_0\). It estimates the instantaneous change in the mean response for a one-unit increase in the predictor at \(x_0\). Its units are response units per predictor unit.

Uncertainty in the Slope at a Chosen Value

The fitted slope at \(x_0\) is a linear combination of coefficient estimates. Its estimated variance includes the variance of each coefficient and their covariance:

$$ \widehat{\operatorname{Var}}(b_1+2x_0b_2) = \widehat{\operatorname{Var}}(b_1) +4x_0^2\widehat{\operatorname{Var}}(b_2) +4x_0\widehat{\operatorname{Cov}}(b_1,b_2). $$

The standard error, denoted \(SE\), is the square root of this estimated variance. Omitting the covariance term is not generally justified: depending on its sign and size, it can increase or reduce the uncertainty in the slope.

Theorem: Under the model assumptions above, a \(100(1-\alpha)\%\) confidence interval for the mean-curve slope at a specified \(x_0\) is
$$ b_1+2x_0b_2 \ \mathbin{\pm}\ t_{1-\alpha/2,\ n-3} \sqrt{ \widehat{\operatorname{Var}}(b_1) +4x_0^2\widehat{\operatorname{Var}}(b_2) +4x_0\widehat{\operatorname{Cov}}(b_1,b_2) }. $$

The degrees of freedom are \(n-3\) because three regression coefficients are estimated. This interval describes uncertainty in the slope of the fitted mean curve; it is not an interval for an individual response, and it does not include the extra variation of a new observation around the mean.

Worked Example: A Slope Interval at a Chosen Predictor Value

Suppose a hypothetical analysis relates weekly energy use \(Y\), in kilowatt-hours, to outdoor temperature \(x\), in degrees Celsius. A quadratic fit uses \(n=20\) days and gives \(b_1=2.00\) and \(b_2=-0.400\). At \(x_0=3\), the estimated coefficient variances and covariance are \(\widehat{\operatorname{Var}}(b_1)=0.250\), \(\widehat{\operatorname{Var}}(b_2)=0.0100\), and \(\widehat{\operatorname{Cov}}(b_1,b_2)=-0.0300\). Assume the quadratic form is suitable over the measured temperature range, the design has full rank, and residual checks show no serious departure from independence, constant variance, or normality.

The estimated slope at \(3^\circ\)C is

$$ b_1+2x_0b_2=2.00+2(3)(-0.400)=-0.400 \quad\text{kilowatt-hours per degree Celsius}. $$

Its estimated variance and standard error are

$$ 0.250+4(3^2)(0.0100)+4(3)(-0.0300) =0.250+0.360-0.360=0.250, \qquad SE=\sqrt{0.250}=0.500. $$

For a 95% interval, \(df=20-3=17\), and \(t_{0.975,17}\approx2.110\). Thus,

$$ -0.400\mathbin{\pm}2.110(0.500) =-0.400\mathbin{\pm}1.055 =(-1.455,\ 0.655). $$

The data and model give a 95% confidence interval of approximately \(-1.455\) to \(0.655\) kilowatt-hours per degree Celsius for the mean-curve slope at \(3^\circ\)C. The interval includes zero, so the estimated slope at that value is not precise enough to establish its direction at this confidence level. This is an interval statement, not a claim that there is a 95% probability that the fixed slope lies in this particular interval.

Why the Covariance Term Appears

The variance formula follows from the standard variance rule for a linear combination. If \(A\) and \(B\) are estimates and \(c\) is a constant, then

$$ \operatorname{Var}(A+cB) =\operatorname{Var}(A)+c^2\operatorname{Var}(B)+2c\operatorname{Cov}(A,B). $$

Set \(A=b_1\), \(B=b_2\), and \(c=2x_0\). Substitution gives

$$ \operatorname{Var}(b_1+2x_0b_2) =\operatorname{Var}(b_1)+4x_0^2\operatorname{Var}(b_2) +4x_0\operatorname{Cov}(b_1,b_2). $$

Replacing the unknown variances and covariance by their estimates gives the standard error used in the interval. This calculation also shows why the uncertainty can differ across the predictor range: both the multiplier of \(b_2\) and the covariance contribution change with \(x_0\).

Uncertainty in the Estimated Vertex

When \(b_2\ne0\), the fitted quadratic has a vertex at

$$ \hat{x}_{v}=-\frac{b_1}{2b_2}. $$

This estimate is a nonlinear function of \(b_1\) and \(b_2\). Its uncertainty can be approximated using the delta method: for a smooth function of estimated coefficients, approximate its variance by multiplying the coefficient covariance matrix on both sides by the gradient of that function, evaluated at the estimates. For \(g(b_1,b_2)=-b_1/(2b_2)\), the gradient is

$$ \nabla g= \left( -\frac{1}{2b_2},\ \frac{b_1}{2b_2^2} \right). $$

Using the estimated variances and covariance gives the first-order approximation

$$ \widehat{\operatorname{Var}}(\hat{x}_v) \approx \left(-\frac{1}{2b_2}\right)^2\widehat{\operatorname{Var}}(b_1) +\left(\frac{b_1}{2b_2^2}\right)^2\widehat{\operatorname{Var}}(b_2) +2\left(-\frac{1}{2b_2}\right) \left(\frac{b_1}{2b_2^2}\right) \widehat{\operatorname{Cov}}(b_1,b_2). $$

The square root of this approximate variance is the estimated standard error of the vertex location. A simple approximate 95% interval is \(\hat{x}_v\mathbin{\pm}1.96SE\). Unlike the slope interval under the normal-error model, this is a first-order approximation, not an exact \(t\) interval. It works best when the denominator \(b_2\) is not close to zero and its uncertainty is not so large that the ratio becomes highly unstable.

Worked Example: An Approximate Interval for the Vertex

Use the hypothetical coefficient estimates and covariance values from the energy-use example. The fitted vertex is

$$ \hat{x}_v=-\frac{2.00}{2(-0.400)}=2.50^\circ\text{C}. $$

The two gradient components, evaluated at the estimates, are

$$ -\frac{1}{2b_2}=-\frac{1}{-0.800}=1.25, \qquad \frac{b_1}{2b_2^2}=\frac{2.00}{2(0.400^2)}=6.25. $$

Substituting the coefficient uncertainty into the delta-method formula gives

$$ \widehat{\operatorname{Var}}(\hat{x}_v) \approx(1.25^2)(0.250)+(6.25^2)(0.0100) +2(1.25)(6.25)(-0.0300) =0.390625+0.390625-0.468750=0.312500. $$

Therefore, \(SE\approx\sqrt{0.312500}=0.5590^\circ\)C. The approximate 95% interval is

$$ 2.50\mathbin{\pm}1.96(0.5590) =2.50\mathbin{\pm}1.096 \approx(1.404,\ 3.596)^\circ\text{C}. $$

Under the first-order approximation, the estimated turning point is \(2.50^\circ\)C, with an approximate 95% interval from \(1.404^\circ\)C to \(3.596^\circ\)C. This interval concerns the predictor location of the vertex, not the response value at the vertex. Its reliability depends on the approximation and on the curvature coefficient being sufficiently well determined.

Centering and a Slope at a Practical Value

A centered predictor can make it easier to calculate a slope at a value of practical interest. If \(z=x-c\), the fitted quadratic can be written \(b_0^*+b_1^*z+b_2^*z^2\). At original predictor value \(x_0\), its slope is \(b_1^*+2b_2^*(x_0-c)\). The same variance rule applies, using the variances and covariance of the centered-model coefficients. The slope and its uncertainty do not depend on whether the predictor was centered, provided the model represents the same fitted curve.

Worked Example: A Slope from a Centered Quadratic

Suppose a hypothetical study models a response \(Y\), in milligrams per litre, using \(z=x-10\), where \(x\) is time in hours. The fitted centered model has \(b_1^*=1.50\) and \(b_2^*=-0.250\). At \(x_0=12\), \(z_0=2\). Assume \(n=30\), \(\widehat{\operatorname{Var}}(b_1^*)=0.160\), \(\widehat{\operatorname{Var}}(b_2^*)=0.00640\), and \(\widehat{\operatorname{Cov}}(b_1^*,b_2^*)=-0.0128\). Assume the mean curve and error conditions described earlier are reasonable over the observed time range, which includes 12 hours.

The slope estimate is

$$ b_1^*+2z_0b_2^*=1.50+2(2)(-0.250)=0.500 \quad\text{milligrams per litre per hour}. $$

Its variance and standard error are

$$ 0.160+4(2^2)(0.00640)+4(2)(-0.0128) =0.160+0.1024-0.1024=0.160, \qquad SE=0.400. $$

Here \(df=30-3=27\), and \(t_{0.975,27}\approx2.052\). The interval is

$$ 0.500\mathbin{\pm}2.052(0.400) =0.500\mathbin{\pm}0.821 \approx(-0.321,\ 1.321). $$

The 95% confidence interval for the mean-curve slope at 12 hours is approximately \(-0.321\) to \(1.321\) milligrams per litre per hour. Centering changes how the calculation is expressed, not what slope is being estimated.

When a Vertex Estimate Is Unstable

The vertex formula divides by \(b_2\). If the fitted curvature coefficient is small, even modest coefficient uncertainty can produce a large change in \(-b_1/(2b_2)\). In that situation the delta-method approximation may poorly describe the uncertainty: the ratio can be strongly skewed, and a symmetric interval may be misleading. A calculated vertex can also fall outside the observed predictor range, where the fitted shape is less supported by data.

A slope interval at a specified \(x_0\) and a vertex interval answer different questions. The slope interval uses a linear combination of coefficient estimates and, under the stated assumptions, has an exact \(t\) form. The vertex interval uses a nonlinear ratio and is only approximate by the delta method. Neither interval by itself establishes that a quadratic model is preferable to a simpler model.

Common Mistakes

  • Dropping the covariance. Treating \(b_1\) and \(b_2\) as independent removes the \(4x_0\widehat{\operatorname{Cov}}(b_1,b_2)\) term without justification. Use the coefficient covariance reported for the fit.
  • Using only the standard error of \(b_1\). The slope at \(x_0\) is \(b_1+2x_0b_2\), not \(b_1\) alone. Include uncertainty in both coefficients.
  • Calling the vertex interval exact. The vertex is a ratio, so the delta-method interval is approximate. Be especially cautious when \(b_2\) is close to zero.
  • Ignoring units or the chosen value. State the predictor value and report slope uncertainty in response units per predictor unit. Report vertex uncertainty in predictor units.
  • Confusing mean-curve uncertainty with response variation. A confidence interval for a slope describes the mean curve’s slope, not the range of individual outcomes around the curve.
Key takeaway: For a quadratic fit, calculate slope uncertainty at a specified predictor value with the variances and covariance of \(b_1\) and \(b_2\). Treat uncertainty in the ratio defining the vertex as approximate, and interpret it cautiously when curvature is weak.

Check Your Understanding

Try these questions without looking back.

  1. For the fitted quadratic slope \(b_1+2x_0b_2\), write its estimated variance and identify the term that accounts for coefficient dependence.
  2. Why does the exact slope interval use \(n-3\) degrees of freedom?
  3. What does a confidence interval for the slope at \(x_0\) describe, and what does it not describe?
  4. Why can a small magnitude of \(b_2\) make the estimated vertex unstable?
  5. For a centered predictor \(z=x-c\), write the fitted slope at original predictor value \(x_0\).