Time Series Analysis

Chapter 7 · Cointegration and VECM

The slide of the lecture is on the left, the same figure or table on the right, computed in the browser from the same data. The ▶ button moves the parameter step by step; the “Worked example” boxes redo the calculation with the numbers of the chapter.

The idea of cointegration · The Engle–Granger two-step method · Error correction models · The VECM and the Granger representation theorem · The Johansen tests · Estimating and interpreting β and α · Forecasting: VECM or VAR in differences? · Economic examples: parity and interest rates · An application: pairs trading

The idea of cointegration

The drunk and her dog by simulation

Slide 7: The drunk and her dog by simulation
Slide 7
    Question for the room Set c = d = 0: neither the drunk nor the dog corrects the distance any more. What p-value does ADF give for the distance y − x?
    Answer

    0.261: the unit root is no longer rejected. Without correction, y − x is the difference of two independent random walks, hence a random walk itself; the standard deviation of the distance rises from 1.86 to 7.07. With c = 0.15 and d = 0.25, ρ = 0.6 and p < 0.001: error correction, not the common starting point, keeps the distance bounded.

    Four pairs of trending series

    Slide 12: Four pairs of trending series
    Slide 12
      Question for the room Drop the first 50% of each sample. Does Engle–Granger still reject “no cointegration” at 5% for US consumption and GDP?
      Answer

      No: τ = −1.95, p = 0.553 on the last 102 quarters, against τ = −3.54, p = 0.029 on 203. With half the data and deviations that last years, the test has little power; a large p means that the relation is not separated from noise in this sample, not that it does not exist. For the banks the test stays below 5% (p = 0.044).

      The Engle–Granger two-step method

      The null distribution by simulation

      Slide 18: The null distribution by simulation
      Slide 18
        Question for the room Switch to T = 50. With the 5% Dickey–Fuller critical value, what share of the samples with 2 variables would reject a true null?
        Answer

        14.2%, about as at T = 200 (14.5%), and 30.0% with 3 variables. The distortion comes from OLS choosing b̂ to make the residuals as small as possible, not from the sample length; at T = 50 the right critical value for 2 variables is −3.46 (simulated quantile −3.41), against −2.92 in the Dickey–Fuller table.

        Critical values of the Engle–Granger test

        Slide 20: Critical values of the Engle–Granger test
        Slide 20
          Question for the room Switch to T = 50. What is the 5% critical value for n = 2, with a constant?
          Answer

          −3.46, against −3.34 asymptotically and −3.37 at T = 200. In small samples the distribution of the statistic is shifted further to the left, so the critical values are more negative; the Dickey–Fuller table (−2.92 at T = 50) would be even further from the right one.

          Worked example: US consumption and income

          Slide 22: Worked example: US consumption and income
          Slide 22

          Worked example

          \[c_t=a+b\,y_t+u_t\ \text{(OLS)},\qquad \Delta\hat u_t=\gamma\,\hat u_{t-1}+\textstyle\sum_{j=1}^{k}\delta_j\Delta\hat u_{t-j}+e_t,\qquad \tau=\hat\gamma/\mathrm{SE}(\hat\gamma)\]
              Question for the room End the sample in 1985. Is “no cointegration” rejected at 5%?
              Answer

              No: τ = −3.00 against the Engle–Granger critical value −3.39 (p = 0.111), on 108 quarters. With the Dickey–Fuller value (−2.89) it would be rejected, wrongly. R² stays above 0.99 and the slope is 1.072, but neither a high R² nor a slope close to 1 proves cointegration.

              The step-1 residuals

              Slide 23: The step-1 residuals
              Slide 23
                Question for the room Drop the first 50% of each sample. Does the lag-8 autocorrelation of the consumption residuals fall?
                Answer

                No: it rises from 0.31 to 0.46, and for the yields ρ̂(12) rises from 0.58 to 0.62. In the second half of the samples the deviations from the long-run relation last longer; the persistence of the residuals depends on the period, which is why the test, not the shape of the ACF, decides.

                Engle–Granger and Phillips–Ouliaris on real data

                Slide 25: Engle–Granger and Phillips–Ouliaris on real data
                Slide 25

                Worked example

                \[\Delta\hat u_t=\gamma\,\hat u_{t-1}+\textstyle\sum_{j=1}^{k}\delta_j\Delta\hat u_{t-j}+e_t,\qquad \tau=\dfrac{\hat\gamma}{\mathrm{SE}(\hat\gamma)}\ \text{against the Engle–Granger critical value}\]
                    Question for the room Drop the first 30% of each sample. Is there still no evidence of cointegration for TLV on BRD since 2010?
                    Answer

                    There is now: τ = −3.98, p = 0.008 (Phillips–Ouliaris p = 0.001), against p = 0.622 on the whole sample since 2010. Without 2010–2014 the relation between the two banks appears; the same pair gives opposite verdicts depending on the start date, which is why choosing the sample after seeing the data is data snooping.

                    Error correction models

                    Speed of adjustment and half-life

                    Slide 31: Speed of adjustment and half-life
                    Slide 31

                    Worked example

                    \[u_h=(1+\gamma)^h u_0,\qquad (1+\gamma)^{h_{1/2}}=0.5\ \Rightarrow\ h_{1/2}=\frac{\ln 0.5}{\ln(1+\gamma)}\]
                        Question for the room Set γ = −0.5. What is the half-life?
                        Answer

                        One period: ln 0.5/ln 0.5 = 1. Half of the deviation disappears at each step, so after one period exactly half is left. The rule 1/|γ| = 2 would assume a linear, not a geometric, adjustment.

                        Half-lives: theory and estimates

                        Slide 32: Half-lives: theory and estimates
                        Slide 32
                          Question for the room End the samples in 1990. What does the half-life of the consumption ECM become?
                          Answer

                          27 quarters: γ̂ = −0.025, with t = −0.66, against 14.3 quarters and t = −1.75 up to 2009. On 1959–1990 the error correction term is not separated from noise, and a γ̂ small in modulus gives a long and imprecise half-life. For the 10-year yield, up to 1990: γ̂ = −0.048 (t = −4.58), 13.9 months.

                          Worked example: one quarter of consumption

                          Slide 34: Worked example: one quarter of consumption
                          Slide 34

                          Worked example

                          \[\Delta c_t=c+\delta_0\,\Delta y_t+\gamma\,\hat u_{t-1}+\dots,\qquad \hat u_{t-1}=c_{t-1}-\hat a-\hat b\,y_{t-1}\]
                              Question for the room Set the deviation ût−1 = −2 (consumption below equilibrium), with income +1%. What does the predicted growth of consumption become?
                              Answer

                              1.05%: 0.418 + 0.537 × 1 + (−0.047) × (−2) = 0.418 + 0.537 + 0.095. When consumption is below equilibrium, the correction term pushes it up, by the same amount by which it held it back in the lecture’s example (0.86%).

                              The VECM and the Granger representation theorem

                              Worked example: a bivariate VECM

                              Slide 41: Worked example: a bivariate VECM
                              Slide 41

                              Worked example

                              \[\Delta\mathbf y_t=\alpha\beta^\top\mathbf y_{t-1}+\mathbf u_t,\quad \beta=(1,-1)^\top,\quad z_t=\beta^\top\mathbf y_t=(1+\beta^\top\alpha)\,z_{t-1}+u_{1t}-u_{2t}\]
                                  Question for the room Set α₂ = −0.1 (with α₁ = −0.1). Does the gap y₁ − y₂ still return to zero?
                                  Answer

                                  No: 1 + βᵀα = 1 + α₁ − α₂ = 1 − 0.1 + 0.1 = 1, so zt = zt−1 + u₁t − u₂t is a random walk. Both variables fall when y₁ > y₂, at the same speed, so the gap does not close: what matters is βᵀα, not the sign of each α.

                                  The Johansen tests

                                  Worked example: from eigenvalues to statistics

                                  Slide 47: Worked example: from eigenvalues to statistics
                                  Slide 47

                                  Worked example

                                  \[\lambda_{\mathrm{trace}}(r)=-T\sum_{i=r+1}^{n}\ln(1-\hat\lambda_i),\qquad \lambda_{\max}(r)=-T\ln(1-\hat\lambda_{r+1}),\qquad T=n_{\mathrm{obs}}-k-1\]
                                      Question for the room End the sample in 2010. What rank does the trace test give?
                                      Answer

                                      Rank 1: λtrace(0) = 45.5 > 29.80, but λtrace(1) = 14.5 < 15.49, with T = 609. Over 1960–2026 the rank is 2. With fewer observations the second, very persistent relation is no longer separated from a unit root; the rank chosen by the test depends on its power too, not only on the structure of the data.

                                      Johansen tests on three systems

                                      Slide 48: Johansen tests on three systems
                                      Slide 48
                                        Question for the room With k = 4 lagged differences in every system, what rank does the trace test give for US output, consumption and investment?
                                        Answer

                                        Rank 1: λtrace(0) = 37.5 > 29.80 and λtrace(1) = 15.3 < 15.49, against rank 0 with k = 1 (28.9, a near miss). The number of lags changes the verdict; for the three currencies the rank stays 0 (28.1).

                                        The deterministic case changes the answer

                                        Slide 50: The deterministic case changes the answer
                                        Slide 50
                                          Question for the room Start the sample in 1990. What rank does case 5 (constant and trend) give?
                                          Answer

                                          Rank 1: λtrace = 41.4, then 11.1 < 18.40, against rank 3 over 1960–2026. On the whole sample the linear trend absorbs the fall of the yields after 1981, and the test ends up calling every yield stationary around a trend; on the sample since 1990 all three cases give rank 1.

                                          Estimating and interpreting β and α

                                          The term-structure VECM

                                          Slide 53: The term-structure VECM
                                          Slide 53
                                            Question for the room End the sample in December 2000. What does the slope of the 10-year yield in the first equilibrium relation become?
                                            Answer

                                            −0.954, against −1.046 over 1960–2026; in the second relation −0.988 against −1.045. Both stay close to −1, so the equilibria are still almost the spreads i⁽¹⁾ − i⁽¹⁰⁾ and i⁽⁵⁾ − i⁽¹⁰⁾. With a super-consistent β̂, a difference of 0.09 on 40 years of data reflects a change of sample, not only estimation noise.

                                            The adjustment coefficients

                                            Slide 55: The adjustment coefficients
                                            Slide 55

                                            Worked example

                                            \[\mathbf z_t=\hat\beta^\top\mathbf y_t,\qquad \mathbf z_t=(I+\hat\beta^\top\hat\alpha)\,\mathbf z_{t-1}+\dots,\qquad h_{1/2}=\frac{\ln 0.5}{\ln|\lambda|}\]
                                                Question for the room End the sample in December 2000. Does the 1-year yield still look weakly exogenous?
                                                Answer

                                                No: t = 2.10 and −3.10 for the two equilibrium errors, against −0.82 and 0.31 over 1960–2026. Before 2001 the short yield also reacted to the deviations from equilibrium; the weak exogeneity of the short end appears on the sample that includes the periods of near-zero policy rates.

                                                Impulse responses of the VECM

                                                Slide 56: Impulse responses of the VECM
                                                Slide 56
                                                  Question for the room End the sample in December 2005. Do the responses to a shock to the 1-year yield return to zero after 60 months?
                                                  Answer

                                                  No: +0.30, +0.30 and +0.29 percentage points for 1, 5 and 10 years (on impact 0.41, 0.27, 0.21). With one common trend, the shock moves the level of all yields permanently, and the responses become almost equal because the spreads return to their means; the same shape appears over 1960–2026 (0.37, 0.36, 0.33).

                                                  Forecasting: VECM or VAR in differences?

                                                  VECM against a VAR in differences, out of sample

                                                  Slide 61: VECM against a VAR in differences, out of sample
                                                  Slide 61
                                                    Question for the room Start the evaluation in 2005. Does the VECM still gain for the 10-year minus 1-year spread at the 36-month horizon?
                                                    Answer

                                                    Yes: relative RMSE 0.83 (75 origins), against 0.74 from 1990, and the VAR in differences stays at 1.00. For the level of the 1-year yield the VECM does not beat the random walk (1.05 at 36 months). Cointegration helps to forecast the relation, not the common trend.

                                                    Economic examples: parity and interest rates

                                                    PPP for the leu

                                                    Slide 65: PPP for the leu
                                                    Slide 65
                                                      Question for the room Start the sample in 2010. Does ADF reject a unit root in the real exchange rate qt?
                                                      Answer

                                                      No: p = 0.924 (with trend 0.957), further from rejection than over 2005–2026 (0.24). Since 2010 the leu depreciated by 23.7 log points while relative prices rose by 33.1: the real exchange rate kept falling. A shorter sample cannot show adjustments with half-lives of several years.

                                                      ROBOR and Euribor

                                                      Slide 67: ROBOR and Euribor
                                                      Slide 67
                                                        Question for the room Start the second sample in 2015. Is Engle–Granger still significant at 5%?
                                                        Answer

                                                        No: τ = −3.24, p = 0.063, and Phillips–Ouliaris gives p = 0.338, against 0.047 and 0.029 since 2010. Moreover, γ̂ of the ROBOR ECM turns positive (0.011): after 2015 ROBOR no longer returns towards the relation with Euribor. With its own monetary policy, the link between the two rates depends strongly on the chosen period.

                                                        Three Central European currencies

                                                        Slide 69: Three Central European currencies
                                                        Slide 69
                                                          Question for the room Start the sample in 2015. What does the trace statistic for r = 0 become?
                                                          Answer

                                                          11.1, against the critical value 29.80: the rank stays 0, as since 2005 (24.2) and since 2012 (12.7). On a shorter sample the test has even less power, and ADF does not reject a unit root for any rate (p = 0.958; 0.626; 0.335). No period shows a common trend of the three currencies.

                                                          An application: pairs trading

                                                          Banca Transilvania and BRD

                                                          Slide 74: Banca Transilvania and BRD
                                                          Slide 74
                                                            Question for the room Start the sample in 2010. What does the half-life of the spread TLV − b̂ BRD become?
                                                            Answer

                                                            About 444 trading days, with ρ̂ = 0.998 and b̂ = 1.68, against 69 days since 2014. Over 2010–2026 the Engle–Granger test does not reject “no cointegration” (p = 0.622): the spread behaves almost like a random walk, and an open position could wait for years. The favourable result since 2014 depends on the chosen start date.

                                                            Pairs trading out of sample

                                                            Slide 76: Pairs trading out of sample
                                                            Slide 76
                                                              Question for the room Double the costs (2×: 0.40% in Bucharest). What net annual return does the strategy earn in Bucharest?
                                                              Answer

                                                              −0.35% per year (Sharpe −0.05), against 0.41% with the lecture’s costs; gross it stays 1.17%. The break-even cost is 0.31%, so any higher cost makes the strategy unprofitable. For the US banks, with a cost of 0.10%, the net return falls only from 2.57% to 2.37%.

                                                              US Treasury yields GS1, GS5, GS10 and TB3MS (FRED, monthly, January 1960 – September 2026), EUR/RON, EUR/HUF and EUR/PLN (BNR, month-end, July 2005 – September 2026), the monthly mean of EUR/RON and the HICP (Eurostat, July 2005 – August 2026), ROBOR 3M and Euribor 3M (Eurostat, August 1995 – August 2026), Romanian household consumption and GDP (Eurostat, 1995Q1 – 2026Q2, the vintage of the lecture, read from the line of the seminar chart, with no point dropped). The yields, BNR rates, HICP, ROBOR and Euribor are read with the chapter’s loaders (FRED, BNR, Eurostat, downloaded on 4 November 2026) and cut at the end dates of the slides; they reproduce the numbers of the lecture exactly. US consumption, income and investment: macrodata of statsmodels (1959Q1 – 2009Q3). Adjusted share prices: data/market. The Engle–Granger, ADF and Johansen tests are recomputed in the browser; the Phillips–Ouliaris statistics, the VECMs, the out-of-sample forecasts and the pairs-trading backtests are those of the chapter code. The simulations use the draws of the chapter’s seed. Variants that do not appear in the lecture (another sample, another number of lags, other thresholds, other costs, other simulation parameters) are extra runs of the chapter code with the same data and seed.