Blog Archive

Saturday, November 13, 2021

Estimating Threshold Adjustment Cointegration Models with Eviews (Part I)

Introduction

Cointegration techniques are a popular approach to detect the long-run relationship among economic variables. One of the classical approaches to investigating the long-run relation is the well-known Engle-Granger method, which assumes a symmetric adjustment to equilibrium. This adjustment implies that the Engle-Granger approach treats adjustment to equilibrium as invariant to the magnitude of the extent and the position of disequilibrium taking place. In other words, whether or not the error correction term is above the equilibrium level, the Engle-Granger approach treats both cases as having similar adjustment process. However, this approach does not permit the asymmetric adjustment of the system towards equilibrium. As experience has shown and demonstrated by a number of researchers, most economic relationships are asymmetric.

To this end, Enders and Siklos (2001) propose a threshold adjustment by extending the Engle-Granger approach to accommodate the asymmetric adjustment to equilibrium (read about it here).The asymmetric error correction can be couched in terms of the already familiar approaches, namely, the Enders-Granger (1998) threshold autoregressive (TAR) and the momentum-TAR (M-TAR) test methods for unit-root. The approach is a generalization of the Tong (1983) method where the degree of autoregressive decay depends on the state of the variable of interest, whereas the M-TAR approach impinges the autoregressive decay on the changes in the variable of interest.

In this post, I discuss and implement the steps that can be used to carry out this cointegration test in Eviews. In particular, I am going to make use of the well-developed suite of threshold estimation method in Eviews. Along the line, I will illustrate the threshold autoregressive (TAR) and Momentum TAR (M-TAR) model.

The Model

Suppose we wish to study the long-run relationship between \(y_t\) and \(x_t\) using the following model:
\[y_t=\alpha+\beta x_t +\epsilon_t\]
Suppose further that the variables are at levels indicating that we are interested in the long-run relation. One way to establish this is to use the well-known Engle-Granger cointegration approach. We’ll have to examine the stationarity of the residuals, \(\hat{\epsilon}_t\), obtained from the regression of \(y_t\) on \(x_t\) (the Engle-Granger approach). This can be done using the standard ADF test. 
\[\Delta\hat{\epsilon}_t=\rho\hat{\epsilon}_{t-1}+\sum^p_{j=1}\theta_j \Delta\hat{\epsilon}_{t-j} +\mu_t\]

Figure 1

If the two series are cointegrated, the residuals should be stationary at levels, that is, the residuals must be I(0). This finding will then indicate the two series are cointegrated. Eviews has an inbuilt procedure for implementing that. Now, suppose, for example, that the two series in question are inflation and interest rate plotted in Figure 1. The Engle-Granger test procedure can be achieved by issuing the command line code or by opening the series to be investigated as a group and then selecting Cointegration Test from View. Clicking on Single-Equation Cointegration Test pops up the default dialog for Engle-Granger cointegration test. Figure 2 reports the EG test result for inflation and interest. The output shows two cases. The first treats interest rate as the dependent variable while the second treats inflation as the dependent variable. Cointegration is established for the two relationships, looking at the p-values.

Figure 2

The following code snippet achieves the same result:

%group="engle_granger"
group {%group} inr infl
freeze(mode=overwrite, eg_result) {%group}.coint(method=eg)
show eg_result

It should be run from the program environment as a prg.

Enders and Siklos Meet Engle and Granger

However, we may suspect that the data generating process (DGP) for the residuals follows TAR or M-TAR process. Enders and Siklos (2001) outline how to study these models. Rather than suspecting if this is the case, we empirically investigate to find out if the data in any way indicate the need to use TAR model. In Figure 3, we estimate the kernel densities for the distributions of the inflation and interest rate when the error correction term is above or below the zero. There is no inherent reason for choosing zero anyway! In the subsequent analysis, we will endogenously determine the threshold value.

Figure 3

Obviously, the figure shows that the kernel densities are different across the regimes depending on whether the error correction term is negative or positive. It follows that modelling the asymmetric adjustment will have a substantial implication for the results. To give more content to our suspicion, we plot the scatterplot for inflation and interest rate in Figure 4. The regression line for positive adjustment is steeper than the regression line for negative adjustment. This plot shows that it is appropriate to fit a TAR model for this relationship.

Figure 4: Implication for long-run relationship

We now turn to the specification and estimation of the TAR model. The process takes the following form:
\[\Delta \hat{\epsilon}_{t}=\rho_1 Q_t \hat{\epsilon}_{t-1} +\rho_1 (1-Q_t) \hat{\epsilon}_{t-1}+\mu_t\]
where \(Q_t=\{I_t, M_t\}\) is
 the Heaviside function given by
\[I_t=\begin{cases} 1, & \text{if}\; \hat{\epsilon}_{t-1}\geqslant\tau\\ 0, & \text{if}\; \hat{\epsilon}_{t-1}\lt\tau \end{cases},\]
for the threshold autoregressive (TAR) model and by
\[M_t=\begin{cases} 1, & \text{if}\; \Delta\hat{\epsilon}_{t-1}\geqslant\tau\\ 0, & \text{if}\; \Delta\hat{\epsilon}_{t-1}\lt\tau \end{cases},\]
for the Momentum Threshold Autoregressive (M-TAR) model. To illustrate we will work with the series on inflation and interest rate used in the plots above.

Steps involved

I'll continue with the example of the relationship between inflation and interest rate. 
STEP 1: Estimate the long-run model and obtain the residuals 
\[infl_t=\alpha+\beta int_t+\epsilon_t\]

Figure 5: Residuals

The residuals are reported in Figure 5. One may not be able to have visual impression of adjustment asymmetry. That is, we are concerned about how fast the system returns to equilibrium following a shock to the system. A speed of adjustment relates the change in the error to the first lag of the error. It is the ratio of the change in residuals to the first lag of the residuals that constitutes the speed and is denoted as (\(\rho\)) in the model being analyzed here. 

Bear in mind that we are not particularly interested in residuals being symmetric or not, but in its adjustment asymmetry. We are interested in the implications of the variations of the residuals (in the positive and negative regimes) for the speed of adjustment. It is in this speed of adjustment that our interest lies. We exploratorily plot the implied regime-based speeds for the relationship. From the plot, we observe that the negative regime depicts steeper slope and so adjustment is much speedier in that regime than in the positive regime. Thus, the exploratory exercise reveals that the adjustment may not likely be symmetric. So let's proceed anyway to figure out more rigorously the asymmetric effect😁.


Figure 6: Speed of adjustment plot

STEP 2: Define the Heaviside function for the TAR model. 
\[I_t=\begin{cases} 1, & \text{if}\; \hat{\epsilon}_{t-1}\geqslant\tau\\ 0, & \text{if}\; \hat{\epsilon}_{t-1}\lt\tau \end{cases}\]
for the TAR model or 
\[M_t=\begin{cases} 1, & \text{if}\; \Delta\hat{\epsilon}_{t-1}\geqslant\tau\\ 0, & \text{if}\; \Delta\hat{\epsilon}_{t-1}\lt\tau \end{cases}\]
for the M-TAR model.
STEP 3: Estimate the following model:
\[\Delta \hat{\epsilon}_{t}=\rho_1 Q_t \hat{\epsilon}_{t-1} +\rho_2 (1-Q_t) \hat{\epsilon}_{t-1}+\mu_t\]
STEP 4: Check for serial correlation and ARCH effect
  • if serial correlation is present, then estimate the following model instead:
\[\Delta \hat{\epsilon}_{t}=\rho_1 I_t \hat{\epsilon}_{t-1} +\rho_2 (1-I_t) \hat{\epsilon}_{t-1}+\sum_{j=1}^{\hat{p}}\theta_j \Delta \hat{\epsilon}_{t-j} +\xi_t\]
where \(\hat{p}=\underset{p\in P}{\text{argmin}} IC(p)\)
  is the optimal lag length obtained through the information criteria
  • if no serial correlation is present, then the model in STEP 3 should be accepted:
\[\Delta \hat{\epsilon}_{t}=\rho_1 Q_t \hat{\epsilon}_{t-1} +\rho_2 (1-Q_t) \hat{\epsilon}_{t-1}+\xi_t\]
where \(Q_t=\{I_t,M_t\}\).
STEP 5: Carry out the cointegration tests: t-Max and  \(\Phi\)-statistic (for \(\tau=0\) ) or t-Max* and \(\Phi^*\)-statistic (if \(\tau\) is unknown). 
\(\Phi^*\): F-statistic of \(\rho_1=\rho_2=0\)
  \(t-\text{Max}^*: \text{max}(t_1,t_2)\) between \(\rho_1=0\) and \(\rho_2=0\)

The critical values for these statistics can be found in Enders and Siklos's original paper.  

STEP 6: Carry out the symmetric adjustment test
            \(H_0: \rho_1=\rho_2\)
STEP 7: The asymmetric adjustment error-correction model is then estimated
\[\Delta infl_t=\alpha+\kappa_1 Q_t \hat{\epsilon}_{t-1}+\kappa_2 (1-Q_t) \hat{\epsilon}_{t-1}+\psi(L)\Delta infl_{t-1}+\phi(L)\Delta int_{t-1}+\eta_t\]
where \(Q_t=\{M_t, Q_t\} \). 

Eviews Implementation

Having presented the steps one needs to follow to estimate the TAR or M-TAR model, I now state how implementations can be done using Eviews. I will discuss two approaches. The first, rather inappropriate for a serious research, is the Click approach. The second approach is to batch the steps involved. If you are itching to jump to into using the code, here you have it.

Click-and-drop approach (OLS-based)

There are two ways the click-and-drop can be used. One is through the LS method. Consider Figure 7. This is OLS estimation method. To estimate the residuals needed according to Step 1, I list infl lner c in the editbox. I estimate the model (results in Figure 8) and make the residuals, which I name as epsilon. The residuals are as reported in Figure 5. 

Figure 7

Figure 8

Figure 9 shows how the combination of Steps 2 and 3 can be executed.

Figure 9

Let me explain how. 
You'll notice that I still use the LS method. Using the residuals obtained previously, I specify the following by list approach:

d(epsilon) epsilon(-1)*(epsilon(-1)<0) epsilon(-1)*(epsilon(-1)>=0)

Both (epsilon(-1)<0) and (epsilon(-1)>=0) in this expression are indicators as given by the indicator function:
\[I_t=\begin{cases} 1, & \text{if}\; \hat{\epsilon}_{t-1}\geqslant\tau\\ 0, & \text{if}\; \hat{\epsilon}_{t-1}\lt\tau \end{cases},\]
and the entire expression refers to 
\[\Delta \hat{\epsilon}_{t}=\rho_1 Q_t \hat{\epsilon}_{t-1} +\rho_2 (1-Q_t) \hat{\epsilon}_{t-1}+\xi_t\]

Another click-and-drop approach (Threshold-based)

The preceding is not the only way to do click-and-drop approach to specify TAR/M-TAR model. Here is an alternative. Use the inbuilt Eviews threshold regression method. This inbuilt alternative offers the flexibility to get the model estimated when the threshold is to be estimated endogenously. It relies on the Bai-Perron approach.

Figure 10

Figure 11

Figures 10 and 11 give the details to specify the model using the inbuilt threshold method in Eviews. In the first editbox, we simply type the dependent variable (that is, d(epsilon)) and the independent variable (that is, epsilon(-1)), while we type the threshold variable (that is, epsilon(-1)) in the
Threshold variable specification editbox. To instruct Eviews that the threshold value should be set to 0, we use the Options tab where we select the User-specified from the dropdown and input 0 in the Values editbox from Threshold specification.

The results from these two alternative ways to estimate the model gives the same results as reported in Figure 12.


Figure 12

But notice that the we've not factored in the fact that the residuals may have serial correlation and ARCH effects. Suppose you already know the optimal lag. We can simply estimate the following, where we have assumed the optimal lag length is 8. The boxed editbox in Figure 13 accounts for this.

Figure 13

The result is presented in Figure 14: 

Figure 14

Code it... 

You'd have noticed that the click-and-drop approach can't meet our need for serious research. The click-and-drop approach is too simple and simplicity is not always a virtue. In particular, we are greatly constrained because we cannot repeatedly carry out (loop) some steps that we might be interested in. For example, we are interested in testing for the optimal lag length to correct for serial correlation, but we simply assumed the lag length to be 8 in Figure 13. This is not acceptable in applied research. 

We might need to invest some time in coding the routine for this method. One advantage doing so is repeatability and reusability. 

In Part II, I'll round off on the steps, discuss how to carry out the relevant hypothesis tests regarding the model discussed here and post the integrated routines (codes) for this method...

4 comments:

Joseph DAVID said...

Nice

teboho said...

Thank you very much for this Prof.!! because I was having a problem on how to create I variable.

Anonymous said...

single threshold with 2 regime how to estimate threshold regression

Anonymous said...

please sir .. kindly teach us

Unit root test with partial information on the break date

Introduction Partial information on the location of break date can help improve the power of the test for unit root under break. It is this ...