Testing for ARCH
Testing for the presence of ARCH in the errors of your model is straightforward. In fact, there are at least two ways to proceed. The first is to estimate the regression portion of your model using least squares. Then choose the Tests>ARCH from the model’s pull-down menu. This is illustrated in Figure 14.3 below.
This brings up the box where you tell gretl what order of ARCH(q) you want as your alternative hypothesis. In the example, q = 1 which leads to the result obtained in the text. The output is shown below in Figure 14.5. Gretl produces the LM statistic discussed in your text; the relevant part is highlighted in red.
The other way to conduct this test is manually. The first step is to estimate the regression
(14.1) using gretl. Save the squared residuals and then regress these on their lagged value. Take TR2 from this regression as your test statistic. The script for this appears below:
open "c:Program FilesgretldatapoeBYD. gdt"
ols r const series ehat = $uhat series ehat2 = ehat*ehat ols ehat2 const ehat2(-1) scalar tr2 = $trsq
The first line estimates the regression
rt = в + et (14.5)
et = ai + «2et-i + ut (14.6)
The notation ehat2(-1) takes the variable ehat2 and offsets it in the dataset by the amount in parentheses. In this case, ehat2(-1) puts a minus one period lag of ehat2 into your regression. The final line computes TR2 from the regression.
Once you’ve estimated your ARCH or GARCH model, you can graph the behavior of the variance as done in the textbook. After estimating ARCH or GARCH, you can save the predicted vari-
ances using the command series ht = $h. Then plot them using gnuplot ht —time-series. The result is shown in Figure 14.2. A prettier plot can be obtained using the pull-down menus and editing the plot yourself using gretl’s Edit dialog box. To modify the graph, right click on the graph and choose Edit. From here you can add labels, change the colors or line style, and add titles. That’s what I have done to produce the result in Figure 14.2.