Category Using gret l for Principles of Econometrics, 4th Edition

Impulse Response Functions and Variance Decompositions

Impulse response functions show the effects of shocks on the adjustment path of the variables. Forecast error variance decompositions measure the contribution of each type of shock to the forecast error variance. Both computations are useful in assessing how shocks to economic variables reverberate through a system.

Impulse response functions (IRFs) and forecast error variance decompositions (FEVD) can be produced after using the var or vecm commands. The results can be presented in a table or a graph.

Obtaining the impulse responses after estimating a VAR is easy in gretl. The first step is to esti­mate the VAR. From the main gretl window choose Model>Time series>Vector Autoregression. This brings up the dialog, shown in Figure 13.13...

Read More

GNU Free Documentation License

Version 1.2, November 2002

Copyright © 2000,2001,2002 Free Software Foundation, Inc.

51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

Everyone is permitted to copy and distribute verbatim copies of this license document, but

changing it is not allowed.


The purpose of this License is to make a manual, textbook, or other functional and useful document “free” in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others.

This License is a kind of “copyleft”, which means that derivative works of the doc...

Read More


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 + e (10.7)

x = nz1 + nz2 + nz3 + v (10.8)

The Zi are exogenous instruments that are each N(0,1). The errors, e and v, are

The parameter n controls the strength of the instruments and is set to either 0.1 or 0.5. The parameter p controls the endogeneity of x. When p = 0, x is exogenous. When p = 0.8 it is seriously endogenous. Sample size is set to 100 and 10,000 simulated samples are drawn.

The gretl script to perform the simulation appears below:

1 scalar N = 100

2 nulldata N

3 scalar rho =0.8 # set r = (0.0 or 0.8)

4 scalar p = 0.5 # set p = (0.1 or 0.5)

5 matrix S = {1, rho; rho, 1}

6 matrix C = cholesky(S)


7 series z1 = norm...

Read More

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 and the regressors is satisfied. The test is based on a measure, H, of the “distance” between the fixed-effects and random-effects estimates, constructed such that under the null it follows the X2 distribution with degrees of freedom equal to the number of time-varying regressors, J. If the value of H is “large” this suggests that the random effects estimator is not consistent and the fixed-effects model is preferable.

There are two ways of calculating H, the matrix-difference method and the regression method. The procedure for the matrix-difference method is this:

• Collect the fix...

Read More

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) models and there are many variations upon the theme.

The first thing to do is illustrate the problem graphically using data on stock returns. The data are stored in the gretl dataset returns. gdt. The data contain four monthly stock price indices: U. S. Nasdaq (nasdaq), the Australian All Ordinaries (allords), the Japanese Nikkei (nikkei) and the U. K. FTSE (ftse). The data are recorded monthly beginning in 1988:01 and ending in 2009:07. Notice that with monthly data, the suffix is two digits, that is 1988:01 is January (01) in the year 1988.

Simple scatter plots appear below...

Read More


Two nonstationary series are cointegrated if they tend to move together through time. For instance, we have established that the levels of the Fed Funds rate and the 3-year bond are non­stationary, whereas their differences are stationary. In the opaque language used in time-series
literature, each series is said to be “integrated of order 1” or I(1). If the two nonstationary series move together through time then we say they are “cointegrated.” Economic theory would suggest that they should be tied together via arbitrage, but that is no guarantee. In this context, testing for cointegration amounts to a test of the substitutability of these assets.

The basic test is very simple. Regress one I(1) variable on another using least squares...

Read More