** Chapter 13.7 ** for W.H. Greene, Econometric Analysis 6th ed. ***************** * (c) Noel Roy 2003, 2008 * * SIMULTANEOUS-EQUATIONS MODELS * COMPARISON OF METHODS - KLEIN'S MODEL I * * This tutorial will review the following tasks in SHAZAM: * • Estimating simultaneous equations by * - Two Stage Least Squares (2SLS command) * - Limited Information Maximum Likelihood (LIML Procedure) * - GMM Estimation (NL /GMM= option) * - Three Stage Least Sqaures (3SLS command) * • Running SHAZAM Procedures * *=============================================================================== * Read in Klein's data. * TIME 1920 1 SAMPLE 1920.0 1941.0 READ (TableF13-1.prn) / NAMES * First generate the necessary variables for the model. * GENR PLAG=LAG(P) GENR XLAG=LAG(X) GENR W=WP+WG GENR A=YEAR-1931 SAMPLE 1921.0 1941.0 * * * 13.5 SINGLE EQUATION: LIMITED INFORMATION ESTIMATION METHODS * (First column of Table 13.3): * * 13.5.1 Ordinary Least Squares * * Estimate separately each of the three equations in Klein's model. OLS C P PLAG W OLS I P PLAG K1 OLS WP X XLAG A * * * 13.5.3 Two-Stage Least Squares * * In general, the format of the 2SLS command is: * 2SLS depvar rhsvars (exogs) / options * where exogs is a list of exogenous variables. SHAZAM automatically * includes a constant term in exogs unless the NOCONEXOG option * is specified. * Note that Greene's standard errors and residual error variance for 2SLS * (but not OLS) are computed using division by N (/DN) rather than by N-K. * 2SLS C P PLAG W (WG G T PLAG K1 XLAG A) / DN 2SLS I P PLAG K1 (WG G T PLAG K1 XLAG A) / DN 2SLS WP X XLAG A (WG G T PLAG K1 XLAG A) / DN * * Keep sample size in N. * GEN1 N = $N * * * 15.6.4 GMM Estimation (H2SLS) * * GMM estimation can be obtained using the NL command, provided that * the weighting matrix is provided by the GMM= option. * In general, the format of the NL command is: * NL neq exogs / NCOEF=n options * EQ equation * COEF values * END * where exogs is the list of exogenous variables in the entire model. * The Weighting matrix used for the estimates in Table 15.3 is based on * White's cocsistent covariance matrix estimator, which can be obtained with * the option GMM=HETCOV. * * Note that the NL routine reports the 2SLS estimates as well. The standard * errors are different from those reported above, because they are estimated * from the White heteroskedasticity-consistent covariance matrix, and so are * more "robust". * NL 1 G T A WG PLAG K1 XLAG /NCOEF=4 GMM=HETCOV EQ C=BETAP*P+BETAPLAG*PLAG+BETAW*W+CONSTANT END * NL 1 G T A WG PLAG K1 XLAG /NCOEF=4 GMM=HETCOV EQ I=BETAP*P+BETAPLAG*PLAG+BETAK*K1+CONSTANT END * NL 1 G T A WG PLAG K1 XLAG /NCOEF=4 GMM=HETCOV EQ WP=BETAX*X+BETAXLAG*XLAG+BETAA*A+CONSTANT END * * As is typical with nonlinear estimation, the solution found depends to * some degree on the algorithm used to find the solution, as well as the * details of convergence griteria and so on. SHAZAM appears to use a * different algorithm than did the solution in the textbook, so these are * not exactly the same values. * * 13.5.4 Limited Information Maximum Likelihood (LIML) * * SHAZAM does not implement LIML directly. However, * a SHAZAM procedure file named LIML is available for equation * estimation (see pp. 461-464 of the SHAZAM Manual). The procedure * can be downloaded from http://shazam.econ.ubc.ca/examples/liml . * (Ssee Chapter 41 of the * SHAZAM Manual for more information on running SHAZAM procedures). * * A vector with the value of one will be defined to represent the constant * term for use in the necessary matrix computations. * GENR ONE=1 * * Define all exogenous variables in the system. * EXOG:ONE G T A WG PLAG K1 XLAG * * Define all endogenous variables in the system. * ENDOG:C P W * * Define right-hand side exogenous variables for the first (Consumption) equation: * RHSEXOG:ONE PLAG * * Define all right-hand side endogenous variables for the C equation. * RHSENDOG:P W * * Define the Left-hand side endogenous variable. * LHS:C * * Now run the PROC (procedure) using the EXEC command. * * The following output is printed: * - Eigenvalues, along with summary statistics and minimum value K_ * - Estimated coefficients for RHSEXOG, followed by those for RHSENDOG. * In the current case, these are in the order CONSTANT PLAG P W. * - The residuals variance estimate SIG2. * - The covariance matrix of the estimates V_. * - The standard errors SE_ * EXEC LIML * * Now do the same for the other two equations: GEN1 $N=N * EXOG:ONE G T A WG PLAG K1 XLAG ENDOG:I P RHSEXOG:ONE PLAG K1 RHSENDOG:P LHS:I EXEC LIML * GEN1 $N=N * EXOG:ONE G T A WG PLAG K1 XLAG ENDOG:WP X RHSEXOG:ONE XLAG A RHSENDOG:X LHS:WP EXEC LIML * * * 13.6 SYSTEM METHODS OF ESTIMATION (Second column of Table 13.3) * * 13.6.1 Three-Stage Least Squares (3SLS) * * The SYSTEM command can extimate 3SLS as well as SUR. With 3SLS, the exogenous * variables in the system must be specified in the SYSTEM command (after the number * of variables is specified). * SYSTEM 3 WG G T A PLAG K1 XLAG / DN OLS C P PLAG W OLS I P PLAG K1 OLS WP X XLAG A * * The I3SLS results can be obtained by iterating the 3SLS estimation. * SYSTEM 3 WG G T A PLAG K1 XLAG / DN ITER=20 OLS C P PLAG W OLS I P PLAG K1 OLS WP X XLAG A * * * 13.6.2 Full-Information Maximum Likelihood (FIML) * * SHAZAM does not directly implement FIML estimation. However, a program to * estimate Klein's model by Full Information Maximum Likelihood is listed * on p. 438-440 of the SHAZAM Manual. This program can be downloaded from * http://shazam.econ.ubc.ca/examples/fiml.sha . * * * 15.6.4 GMM Estimation (H3SLS) * * There are insufficient observations to fit the system as a whole. * Greene estimates the system in two pairs, (C,I) and (C, WP), * and reports the first of these for the C equation. * * First pair: * NL 2 G T A WG PLAG K1 XLAG /NCOEF=8 GMM=HETCOV EQ C=BETAP1*P+BETAPLG1*PLAG+BETAW1*W+CON1 EQ I=BETAP2*P+BETAPLG2*PLAG+BETAK2*K1+CON2 END * * Second pair: * NL 2 G T A WG PLAG K1 XLAG /NCOEF=8 GMM=HETCOV EQ C=BETAP1*P+BETAPLG1*PLAG+BETAW1*W+CON1 EQ WP=BETAX3*X+BETAXLG3*XLAG+BETAA3*A+CON3 END * STOP * *=============================================================================== * Updated October 22, 2008