Using gret l for Principles of Econometrics, 4th Edition

Okun’s Law

Okun’s Law provides another opportunity to search for an adequate specification of the time - series model. Load the okun. gdt data. These quarterly data begin at 1985:2. Set the data structure to time-series if needed. In this example, the model search is over p = 0,1, 2 and q = 1, 2, 3. There are 12 possible models to consider and loops will again be used to search for the preferred one.

To make the loop simpler, the modelsel function has been modified slightly. It now accepts a single variable list as its input. This allows us to place the dependent variable, x, and its first lag into the model as x(0 to -1). Gretl reads this as x x(-1). Thus, these two regressions would yield the same result

ols x const x(-1) ols x(0 to -1) const

Placing the constant at the end of the list only moves its position in the output, it does not change the substance of the results.

Подпись: 1 2 3 4 5 6 7 1 9 10 11 12 image314

The new and improved modelsel2 appears below:

Notice that the input on line one is now just a single variable list. Line 6 is modified by subtracting one from the number of elements in the variable list, since the list now includes the dependent variable. Also, the printf statements are commented out to reduce the amount of output sent to the screen. You can remove the # from lines 9 and 10 if you want to see what’s in the model and the results at each iteration. Since we are dealing with an ARDL(p, q), p and q tell us exactly which regressors are in the model so these are really not needed in the current context.

The new and improved loop to compute the model selection rules is:

Loop for the Okun Example

1 open "@gretldirdatapoeokun. gdt"

2 diff u

3 smpl 1986:1 2009:3

4 matrix A = {}

5 loop p = 0..2 —quiet

6 loop q = 1..3 —quiet

7 if p=0

8 list vars = d_u g(0 to - q) const

9 else

10 list vars = d_u(0 to - p) g(0 to - q) const

11 endif

12 matrix a = p~q~modelsel2(vars)

13 matrix A = A | a

14 endloop

15 endloop

16 colnames(A,"p q K N AIC SC ")

17 print A

18 function modelsel2 clear

This loop improves upon the last in at least one way. It now contains a nest that should function properly for any p>1 and q>0. The first three lines load the data, create the difference of unem­ployment, and set the sample to match the one used in POE4. This script contains two loops, one for p and one for q that are nested. When loops are nested this way, the p loop starts at zero and then the q loop iterates from 1 to 3. Once the q loop is finished, the p loop increments by 1 and the q loop starts over again.

The conditional if statement is necessary because when p=0 the statement d_u(0 to -p) in line 10 cannot be computed. The last line clears the modelsel2 function from memory. If you need to modify the function, perform your changes, and re-run it to load it into memory. Once loaded into memory, there is no need to run it again.

The results from this script are

p

q

K

N

AIC

SC

0.0000

1.0000

3.0000

95.000

-3.4362

-3.3556

0.0000

2.0000

4.0000

95.000

-3.4634

-3.3559

0.0000

3.0000

5.0000

95.000

-3.4424

-3.3080

1.0000

1.0000

4.0000

95.000

-3.5880

-3.4805

1.0000

2.0000

5.0000

95.000

-3.5675

-3.4331

1.0000

3.0000

6.0000

95.000

-3.5612

-3.3999

2.0000

1.0000

5.0000

95.000

-3.5693

-3.4349

2.0000

2.0000

6.0000

95.000

-3.5483

-3.3870

2.0000

3.0000

7.0000

95.000

-3.5491

-3.3609

The ARDL(1,1) minimizes both AIC and SC. The estimates for this model are:

OLS, using observations 1985:4-2009:3 (T = 96)

Dependent variable: d_u

Подпись:Подпись: 0.288736 0.162277 0.684126 1.04e-23 -72.79155 -68.64534 0.437108

Подпись: Mean dependent var Sum squared resid R2 F(3, 92) Log-likelihood Schwarz criterion p
Подпись: S.D. dependent var S.E. of regression Adjusted R2 P-value(F) Akaike criterion Hannan-Quinn Durbin’s h

HAC standard errors, bandwidth 3 (Bartlett kernel)

Coefficient

Std. Error

t-ratio

p-value

const

0.378010

0.0671726

5.6275

0.0000

g

-0.184084

0.0268375

-6.8592

0.0000

g-1

-0.0991552

0.0388520

-2.5521

0.0124

d_u_1

0.350116

0.0861251

4.0652

0.0001

9.7.2 Autoregressive Models

An autoregressive model is just a special case of an ARDL(p, q) where q = 0. The model only includes lags of the dependent variable.

yt = 5 + diyt-i + 02yt-2------- + OpVt-p + vt (9.13)

The example is based on the okun. gdt data. An initial AR(2) model is estimated using GDP growth. The possibility of residual autocorrelation is explored using LM tests and by looking at the correlogram.

1 open "@gretldirdatapoeokun. gdt"

2 ols g(0 to -2) const

3 series res = $uhat

4 corrgm res

5 loop i = 1..4

6 modtest $i —autocorr —quiet

7 endloop

The correlogram appears in Figure 9.14 below. Only the autocorrelation at the 12th lag is signifi­cant, probably by chance. None of the LM statistics computed by the modtest loop have p-values smaller than 10%, therefore this model may be properly specified. To see how this compares with others via the model selection rules, we use another loop and the modesel2 function.

1 open "@gretldirdatapoeokun. gdt"

2 smpl 1986:3 2009:3

3 matrix A = {}

4 scalar q=0

5 loop p = 1..5 —quiet

6 list vars = g(0 to - p) const

7 matrix a = p~q~modelsel2(vars)

8 matrix A = A | a

9 endloop

10 colnames(A,"p q K N AIC SC ")

11 print A

The sample was shortened again and the nested loop is removed. Otherwise, this is the same as used to model select in the ARDL(p, q) example. The results

p

q

K

N

AIC

SC

1.0000

0.0000

2.0000

93.000

-1.0935

-1.0391

2.0000

0.0000

3.0000

93.000

-1.1306

-1.0489

3.0000

0.0000

4.0000

93.000

-1.1242

-1.0153

4.0000

0.0000

5.0000

93.000

-1.1332

-0.99700

5.0000

0.0000

6.0000

93.000

-1.1117

-0.94827

match those in POE4. The AR(2) model is supported by the SC while the AIC chooses one with 4 lags. As mentioned previously, the SC criterion imposes a slightly larger penalty for adding regressors and may sometimes leas to smaller models.

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

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 512 11 94 — гл. инженер-менеджер (продажи всего оборудования)

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

Партнеры МСД

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

+38 096 992 9559 Инна (вайбер, вацап, телеграм)
Эл. почта: inna@msd.com.ua