Using the Dialogs

Return to the main gretl window and choose Model>Ordinary least squares. This will bring up the ‘specify model’ dialog box. Choose g as the dependent variable as shown.

Since your data are defined as time-series (recall, you did this through Data>Dataset structure) an extra button, labeled ‘lags…’, appears at the bottom of the dialog. Click the ‘lags…’ button in the specify model dialog box and the ‘lag order’ dialog box shown on the right-hand side in Figure

9.7 opens.

Click OK and the 3 lagged values of GDP growth are added to the model. Now, click OK in the specify model dialog and the model is estimated.

Now, we’ll use the dialogs to extend the sample and generate the forecasts. From the model window choose Analysis>Forecasts. This opens the ‘Add observations’ dialog box shown in Figure 9.15. To add three observations change the number in the box to 3. Click OK to open the forecast dialog box shown below in Figure 9.16.

By choosing to add 3 observations to the sample, the forecast range is automatically set to 2009:4 to 2010.2. Notice that we’ve chosen ’automatic forecast (dynamic out of sample).’ Click OK and the forecast results appear.

A script is actually much simpler. Here is the example in a script.

open "@gretldirdatapoeokun. gdt"

2 ols g(0 to -2) const

3 dataset addobs 3

4 fcast 2009:4 2010:2 —plot=c:tempar2plot. plt

In line 3 the dataset addobs tells gretl to add 3 observations to the dataset. Then, the fcast command with the desired dates to forecast are given. The results are:

For 95% confidence intervals, t(93, 0.025) = 1.986


g prediction

std. error

95% interval




-0.379448 –





-0.239499 –





-0.253530 –


Miraculously, these match those in POE4! Gretl can optionally use gnuplot to plot the time-series and the forecasts (with intervals). The plot is shown in Figure 9.17.[71] The last three observations are forecasts (in blue) and include the 95% confidence intervals shown in green. Actual inflation appears in red. From an economics standpoint, the forecast is depressing, mainly because the intervals are very wide. The 95% interval includes a possible recession.

Leave a reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>