Tutorials › Econometrics (Graduate) › GLS Transformations for AR(1) Errors

Generalized Least Squares · Tutorial 148 of 952

GLS Transformations for AR(1) Errors

Learn how stationary AR(1) errors transform into uncorrelated errors and how the transformed regression yields GLS estimates.

Intermediate 10 min read

What You'll Learn

  • State the stationary AR(1) error model and its covariance assumptions.
  • Derive the transformation that whitens the error covariance matrix.
  • Explain why the first observation requires a different scaling.
  • Connect transformed least squares to the GLS criterion.
  • Calculate GLS coefficient estimates for a short time-ordered regression.
  • Identify why an unconditional covariance claim may not justify conditional GLS.

Why Transform a Regression With Serially Correlated Errors?

In a time-ordered regression, errors may be correlated across observations even after the conditional mean has been modeled. When that dependence follows a stationary first-order autoregressive structure, the covariance matrix has a particularly useful form: a simple difference between adjacent observations removes the serial correlation after the first observation. The first observation needs a separate adjustment because it has no preceding observation to difference against.

This transformation is not a change to the substantive regression model. It rewrites the same GLS criterion as ordinary least squares on transformed outcomes and regressors. The distinction matters: the transformation depends on the assumed error covariance, and the covariance assumptions must hold for the design being analyzed.

Model and Covariance Assumptions

Definition: Consider the linear regression \(y_t=x_t'\beta+u_t\), \(t=1,\ldots,n\), where \(x_t\) is a \(k\)-vector of regressors (including an intercept if required) and \(\beta\) is the coefficient vector. The errors follow a stationary AR(1) covariance model when \(u_t=\rho u_{t-1}+\varepsilon_t\), \(|\rho|<1\), and the innovations have mean zero, variance \(\sigma_\varepsilon^2\), and are uncorrelated over time. Under stationarity, \(\operatorname{Var}(u_t)=\sigma_\varepsilon^2/(1-\rho^2)\) and \(\operatorname{Cov}(u_s,u_t)=\sigma_\varepsilon^2\rho^{|t-s|}/(1-\rho^2)\).

For this tutorial, treat the regressors as fixed and assume the error covariance is the stationary AR(1) covariance just stated. Equivalently, with random regressors, impose the corresponding conditional moment assumptions explicitly: \(E(u\mid X)=0\) and \(\operatorname{Var}(u\mid X)=\sigma_\varepsilon^2R/(1-\rho^2)\), where \(R_{st}=\rho^{|t-s|}\). An unconditional covariance statement alone does not establish this conditional covariance. This qualification ensures that the GLS calculation is justified for the design at hand.

Write \(\Omega=\operatorname{Var}(u)=\sigma_\varepsilon^2R/(1-\rho^2)\) for a fixed design. GLS minimizes the error quadratic form \((y-X\beta)'\Omega^{-1}(y-X\beta)\). The goal is to find a matrix transformation \(T\) for which \(T\Omega T'=\sigma_\varepsilon^2 I\), so the transformed errors have equal variance and zero covariance across observations.

Deriving the AR(1) Transformation

For each observation after the first, subtract \(\rho\) times the preceding observation. The regression equation becomes \(y_t-\rho y_{t-1}=(x_t-\rho x_{t-1})'\beta+(u_t-\rho u_{t-1})\). Because the AR(1) equation gives \(u_t-\rho u_{t-1}=\varepsilon_t\), these later transformed errors are the innovations. But the first observation is not an innovation: \(u_1\) has stationary variance \(\sigma_\varepsilon^2/(1-\rho^2)\). Multiplying the first equation by \(\sqrt{1-\rho^2}\) gives it the same error variance as the innovations.

Theorem: Under the stationary AR(1) covariance assumptions, define \(T\) by the first transformed row \(\sqrt{1-\rho^2}\) times observation 1 and, for \(t\geq2\), transformed row \(t\) equal to observation \(t-\rho\) times observation \(t-1\). Then \(T\Omega T'=\sigma_\varepsilon^2 I\). Thus the transformed regression has errors with covariance \(\sigma_\varepsilon^2 I\), and its least-squares coefficient estimate equals the GLS estimate under \(\Omega\).

In equations, if \(y^*=Ty\) and \(X^*=TX\), the rows are

$$ y_1^*=\sqrt{1-\rho^2}\,y_1,\qquad y_t^*=y_t-\rho y_{t-1}\quad (t\geq2), $$

and each regressor column is transformed by exactly the same rule. In particular, an intercept column becomes \(\sqrt{1-\rho^2}\) in the first row and \(1-\rho\) in each later row. It does not remain a column of ones.

1
Adjust the first row.
Multiply the first outcome and every first-row regressor by \(\sqrt{1-\rho^2}\).
2
Difference subsequent rows.
For each \(t\geq2\), subtract \(\rho\) times the previous outcome and regressor row.
3
Run least squares on the transformed data.
Regress \(y^*\) on \(X^*\); with the stated covariance assumptions, the resulting coefficient estimate is GLS.

Why the Transformation Gives GLS

The key justification is that the transformation whitens the specified covariance, rather than merely making adjacent observations look less correlated. To see the covariance calculation directly, \(v_1=\sqrt{1-\rho^2}u_1\) has variance \(\sigma_\varepsilon^2\). For \(t\geq2\), \(v_t=u_t-\rho u_{t-1}=\varepsilon_t\), whose variance is also \(\sigma_\varepsilon^2\). Under the stationary AR(1) model, the initial error is uncorrelated with subsequent innovations, and the innovations are uncorrelated with one another. Hence the transformed errors have covariance \(\sigma_\varepsilon^2 I\).

The GLS equivalence follows by substituting \(\Omega^{-1}=\sigma_\varepsilon^{-2}T'T\) into its criterion. The positive scalar \(\sigma_\varepsilon^{-2}\) does not change the minimizer, leaving the transformed sum of squared residuals.

$$ \begin{aligned} (y-X\beta)'\Omega^{-1}(y-X\beta) &=\frac{1}{\sigma_\varepsilon^2}(y-X\beta)'T'T(y-X\beta)\\ &=\frac{1}{\sigma_\varepsilon^2}\bigl\|Ty-TX\beta\bigr\|^2. \end{aligned} $$

Therefore, minimizing the GLS criterion over \(\beta\) is equivalent to minimizing \(\|y^*-X^*\beta\|^2\). This proves the coefficient-estimate equivalence. It does not claim that a covariance model is correct merely because a transformation has been applied; the assumed covariance structure remains essential.

Worked Example: Transforming Outcomes and Regressors

Suppose three hypothetical observations have \(y=(10,12,13)'\), and a single regressor has values \(x=(1,2,4)'\). Let the assumed AR(1) parameter be \(\rho=0.5\). Apply the transformation, including its first-row adjustment.

Here \(\sqrt{1-\rho^2}=\sqrt{0.75}\approx0.8660\). For the outcome, the first transformed value is \(0.8660(10)=8.660\). The next two are \(12-0.5(10)=7\) and \(13-0.5(12)=7\). Thus \(y^*=(8.660,7,7)'\), to four significant figures.

Apply the identical operation to the regressor: \(x_1^*=0.8660(1)=0.8660\), \(x_2^*=2-0.5(1)=1.5\), and \(x_3^*=4-0.5(2)=3\). Therefore \(x^*=(0.8660,1.5,3)'\). If the model includes an intercept, its transformed column is \((0.8660,0.5,0.5)'\), not \((1,1,1)'\).

This calculation assumes that \(\rho=0.5\) is the covariance parameter being used and that the stationary covariance assumptions hold for these observations. It illustrates the transformation only; coefficient estimation would require transforming every regressor column and then fitting the transformed regression.

Worked Example: Verifying the First-Observation Adjustment

For \(n=3\) and \(\rho=0.5\), verify that the transformation gives an identity covariance matrix up to the factor \(\sigma_\varepsilon^2\). The stationary error covariance is

$$ \Omega=\sigma_\varepsilon^2 \begin{pmatrix} 4/3&2/3&1/3\\ 2/3&4/3&2/3\\ 1/3&2/3&4/3 \end{pmatrix}, \qquad T= \begin{pmatrix} \sqrt{0.75}&0&0\\ -0.5&1&0\\ 0&-0.5&1 \end{pmatrix}. $$

The first transformed variance is \(0.75(4/3)\sigma_\varepsilon^2=\sigma_\varepsilon^2\). For the second row, the variance is \([0.25(4/3)+4/3-2(0.5)(2/3)]\sigma_\varepsilon^2=\sigma_\varepsilon^2\). The third row has the same variance by the same calculation.

For example, the covariance between the first and second transformed errors is \(\sqrt{0.75}[-0.5(4/3)+2/3]\sigma_\varepsilon^2=0\). For the second and third transformed errors, it is \([2/3-(0.5)(4/3)-(0.5)(1/3)+0.25(2/3)]\sigma_\varepsilon^2=0\). The first and third transformed errors also have zero covariance: \(\sqrt{0.75}[-0.5(2/3)+1/3]\sigma_\varepsilon^2=0\). Thus \(T\Omega T'=\sigma_\varepsilon^2 I\), including the first row. Without its special scaling, the first transformed error would not have the innovation variance.

Calculating GLS Estimates

The following example computes the coefficients rather than stopping at the transformation. The data are hypothetical and ordered in time. Assume the regression has an intercept and a linear time regressor, and use a known AR(1) covariance parameter \(\rho=0.5\). As above, the regressors are treated as fixed and the error covariance is assumed to be the stationary AR(1) covariance. These conditions make the transformed least-squares estimate the GLS estimate.

Worked Example: GLS for a Short Time-Ordered Dataset

Let \(t=1,2,3,4\), use \(x_t=t-1\), and observe \(y=(2,3,4,5)'\). Fit \(y_t=\beta_0+\beta_1x_t+u_t\) with \(\rho=0.5\). Transform the first row using \(\sqrt{0.75}\approx0.8660\). The transformed outcome is \((1.732,2,2.5,3)'\), and the transformed intercept and time-regressor columns are \((0.8660,0.5,0.5,0.5)'\) and \((0,1,1,1)'\), respectively.

Write \(b_0,b_1\) for candidate coefficients. The transformed residual sum of squares is

$$ Q(b_0,b_1)=0.75(2-b_0)^2+ (2-0.5b_0-b_1)^2+ (2.5-0.5b_0-b_1)^2+ (3-0.5b_0-b_1)^2. $$

The three later transformed outcomes have mean \(2.5\), and their squared deviations from that mean sum to \((2-2.5)^2+(2.5-2.5)^2+(3-2.5)^2=0.5\). Consequently, for any \(b_0,b_1\), the last three terms can be written as \(0.5+3(2.5-0.5b_0-b_1)^2\). Thus

$$ Q(b_0,b_1)=0.75(2-b_0)^2+0.5+ 3(2.5-0.5b_0-b_1)^2. $$

The first term is minimized at \(b_0=2\), while the final squared term can be zero by setting \(b_1=2.5-0.5b_0\). At \(b_0=2\), this gives \(b_1=1.5\). The resulting GLS estimates are \(\hat{\beta}_0=2\) and \(\hat{\beta}_1=1.5\). The intercept is in outcome units, and the slope is in outcome units per one-unit increase in \(x_t\). This is the estimate for the specified \(\rho\) and covariance model; it is not the ordinary least-squares estimate from the untransformed observations.

Interpretation, Use, and a Common Pitfall

The transformation is useful because it converts a particular GLS problem into a familiar least-squares calculation while preserving the GLS coefficient estimate. Its simplicity depends on the AR(1) structure and on using the correct \(\rho\). A different covariance pattern generally calls for a different whitening transformation. Also, the transformed regression is a computational representation of the GLS objective, not evidence by itself that the original errors follow a stationary AR(1) process.

A common mistake is to difference every row using \(y_t-\rho y_{t-1}\), including the first observation, or to leave the first observation unadjusted while treating all transformed errors as having variance \(\sigma_\varepsilon^2\). The first observation has no predecessor, and under stationarity its original error variance is \(\sigma_\varepsilon^2/(1-\rho^2)\), not \(\sigma_\varepsilon^2\). Multiplication by \(\sqrt{1-\rho^2}\) is what brings its transformed variance to the innovation variance.

A second important pitfall is to infer a conditional covariance model from an unconditional one when regressors are random. GLS conditional on \(X\) requires the conditional covariance to have the stipulated form (and the conditional mean to be correctly specified). State whether the design is fixed or give the conditional moment assumptions; do not substitute an unconditional covariance statement for them.

Key takeaway: For stationary AR(1) errors, scale the first observation and its regressors by \(\sqrt{1-\rho^2}\), then transform each later row by subtracting \(\rho\) times the preceding row. Under the specified covariance assumptions, least squares on these transformed data is GLS.

Check Your Understanding

Use the model, covariance assumptions, and transformation developed above.

  1. For \(\rho=0.6\), what multiplier is applied to the first observation, and what is the transformation for observation \(t=3\)?
  2. In a regression with an intercept, what are the first two entries of the transformed intercept column?
  3. Why does the first transformed error require a different operation from later transformed errors?
  4. What assumptions permit the transformed least-squares coefficient estimate to be interpreted as GLS conditional on random regressors?
  5. If \(\operatorname{Var}(u\mid X)\) is not the stated AR(1) covariance, what part of the GLS justification cannot be concluded from this transformation alone?
Clinical Biostats