Using gret l for Principles of Econometrics, 4th Edition

Selecting Lag Length

The second consideration is the specification of lags for the ADF regressions. There are several ways to select lags and gretl automates one of these. The basic concept is to include enough lags in the ADF regressions to make the residuals white noise. These will be discussed presently.

Testing Down

The first strategy is to include just enough lags so that the last one is statistically significant. Gretl automates this using the —test-down option for the augmented Dickey-Fuller regressions. Start the ADF regressions with a generous number of lags and gretl automatically reduces that number until the t-ratio on the longest remaining lag is significant at the 10 percent level. For the levels series we choose the maximum number using Schwert’s method as discussed in chapter 12. The model includes a constant, trend, and trend squared (—ctt option), and use the —test-down option.

1 scalar mlag = int(12*(($nobs+1)/100)"(0.25))

2 adf mlag usa —ctt —test-down

3 adf mlag aus —ctt —test-down

The USA series contains a very long significant lag twelve periods into the past. The Australian series shows much less persistence, choosing only 3 in testing down from 12. The result is shown in Figure 13.2. Both ADF statistics are insignificant at the 5% or 10% level, indicating they are nonstationary. This is repeated for the differenced series using the commands:

adf mlag diff(usa) —ct —test-down adf mlag diff(aus) —ct —test-down

The selected lags for the U. S. and Australia are eleven and seven, respectively. Both ADF statistics are significant at the 5% level and we conclude that the differences are stationary.

Testing Up

The other strategy is to test the residuals from the augmented Dickey-Fuller regressions for autocorrelation. In this strategy you can start with a small model, and test the residuals of the Dickey-Fuller regression for autocorrelation using an LM test. If the residuals are autocorrelated, add another lagged difference of the series to the ADF regression and test the residuals again. Once the LM statistic is insignificant, you quit you are done. This is referred to as testing-up. You will still need to start with a reasonable number of lags in the model or the tests will not have desirable properties.

To employ this strategy in gretl, you’ll have to estimate the ADF equations manually using the ols command. Since the data series has a constant and quadratic trend, you have to define a time trend (genr time) and possibly trend squared (square time) to include in the regressions.[77]

witln constant and quadratic trend

model: (l-L)y = ЬО + bl*t + b2*t~2 + (a-l)*y(-l) + ... + e

lst-order autocorrelation coeff. for e: 0.005

lagged differences: F(12, Э5) = 3.170 [0.0008]

estimated value of (a - 1): -0.12Э066

test statistic: tau_ctt(1) = -2.47237

asymptotic p-value 0.5843

? adf mlag aus —ctt —test-down

witln constant and quadratic trend

model: (l-L)y = b0 + bl*t + b2*t~2 + (a-l)*y(-l) + ... + e

lst-order autocorrelation coeff. for e: 0.028

lagged differences: F(3, 113) = 2.543 [0.0598]

estimated value cf fa - 11: -0.157192

test statistic: tau_ctt(1) = -3.32732

asymptotic p-value 0.163

Figure 13.2: Based on ADF tests, the levels of Australian and U. S. GDP are nonstationary.

Note this is another one of those cases where you cannot use series in place of genr. The genr time is a special function for genr. The other cases include genr dummy and genr unitdum. You will also need to generate the differences to use in a new function called lags. The script to do this follows:

1 genr time

2 square time

3 diff usa aus

Now, estimate a series of augmented Dickey-Fuller regressions using ols. Follow each regression with the LM test for autocorrelation of the residuals discussed in chapter 9.

1 loop i=1..12

2 ols d_usa(0 to - i) usa(-1) const time sq_time —quiet

3 printf "ADF lag order = %dn",i

4 modtest 1 —autocorr —quiet

5 end loop

The first ols regression is the ADF(1). It includes 1 lagged value of the d_usa as a regressor in addition to the lagged value of usa, a constant, a trend, and a squared trend. Gretl’s variable(i to j) function creates a series of lags from i through j of variable. So in the first regression, d_usa(0 to - i) creates the contemporaneous value and a single lagged value of d_usa. Since the contemporaneous value, d_usa, appears first in the variable list, it is taken as the dependent variable. A printf statement is issued to remind us of which test we are performing. Then the LM and other AR tests are conducted using modtest 1 —autocorr —quiet. If the p-value is greater than 0.10 then, this is your model. If not, consider the outcome of the next loop which has added another lag of d_usa to the model. Stop when the p-value is greater than 0.10.

In this code example we chose to suppress the results from the first regression so that the output from the tests would fit on one page (Figure 13.3). In practice, you could skip this option and read the Dickey-Fuller t-ratio directly from the output. The only disadvantage of this is that the proper p-value for it is not computed using the manual approach.

Figure 13.3: Testing up: manually estimate the ADF regressions and use LM tests for autocorre­lation to determine the proper lag length.

If you repeat this exercise for aus (as we have done in the script at the end of the chapter[78]) you will find that testing up determines zero lags of d_aus are required in the Dickey-Fuller regression; testing down revealed three lags were needed. The incongruence occurs because we did a poor job of testing up, failing to include enough autocorrelation terms in the LM test. This illustrates a danger of testing up. When we conducted the LM test using only a single autocorrelation term, we had not searched far enough in the past to detect significant autocorrelations that lie further back in time. Adding terms to the autocorrelation test using modtest 3 —autocorr would have helped to detect this.

So which is better, testing down or testing up? I think the econometric consensus is that testing down is safer. We’ll leave it for future study!

Добавить комментарий

Using gret l for Principles of Econometrics, 4th Edition

Simulation

In appendix 10F of POE4, the authors conduct a Monte Carlo experiment comparing the performance of OLS and TSLS. The basic simulation is based on the model y = x …

Hausman Test

The Hausman test probes the consistency of the random effects estimator. The null hypothesis is that these estimates are consistent-that is, that the requirement of orthogonality of the model’s errors …

Time-Varying Volatility and ARCH Models: Introduction to Financial Econometrics

In this chapter we’ll estimate several models in which the variance of the dependent variable changes over time. These are broadly referred to as ARCH (autoregressive conditional heteroskedas - ticity) …

Как с нами связаться:

Украина:
г.Александрия
тел./факс +38 05235  77193 Бухгалтерия

+38 050 457 13 30 — Рашид - продажи новинок
e-mail: msd@msd.com.ua
Схема проезда к производственному офису:
Схема проезда к МСД

Партнеры МСД

Контакты для заказов оборудования:

Внимание! На этом сайте большинство материалов - техническая литература в помощь предпринимателю. Так же большинство производственного оборудования сегодня не актуально. Уточнить можно по почте: Эл. почта: msd@msd.com.ua

+38 050 512 1194 Александр
- телефон для консультаций и заказов спец.оборудования, дробилок, уловителей, дражираторов, гереторных насосов и инженерных решений.