** Chapter 16.4 ** for W.H. Greene, Econometric Analysis 6th ed. ***************** * (c) Noel Roy 2003, 2008 * * 16.4 PROPERTIES OF MAXIMUM LIKELIHOOD ESTIMATORS * * 16.4.6 Estimating the Asymptotic Variance of the Maximum Likelihood Estimator * * This tutorial reviews the following tasks in SHAZAM: * • Estimation by maximum likelihood (MLE command or NL /LOGDEN option) * • Calculating the asymptotic variance of the estimate * *=============================================================================== * Example 16.4 (p. 496) Variance Estimators for an MLE READ (TableFC-1.prn) I Y X / LIST SKIPLINES=1 * * The MLE command does Maximum Likelihood Estimation of some * regression models with non-normal errors. * In general, the format of the MLE command is: * MLE depvar indeps / options * The option /TYPE= specifies the type of distribution to be assumed for * the errors. The Exponential distribution EXP is the default. For further * information on the MLE command, see chapter 21 of the SHAZAM Manual. * MLE Y X * * While the distribution in Example 16.4 is an exponential, the coefficient * of the X variable is fixed at unity. Since the MLE command cannot restrict * parameter values, it cannot replicate the model in Example 16.4. * TEST X=1 * The hypothesis that the coefficient on X is unity cannot be rejected. * * A more general approach to maximum likelihood estimation is through the * NL command for the estimation of non-linear models. The LOGDEN option * tells SHAZAM that the equation given on the EQ command is the LOG-DENSITY * for a single observation. * In general, the format is (see chapter 22 of the SHAZAM Manual): * NL neq exogs / NCOEF= options * EQ equation * COEF values * END * where exogs are the list of instrumental variables for N2SLS or N3SLS. * NL 1 /NCOEF=1 LOGDEN GENRVAR STDERR=sigma EQ -LOG(BETA+X)-Y/(BETA+X) END * The option GENRVAR takes a vector of coefficients and generates a set * of scalar variables (here BETA) for later use. * * The default asymptotic variance as calculated by SHAZAM is GEN1 sigma**2 * Generally, this is based on an estimate * of the actual second-derivative of the log-likelihood function at the * maximum-likelihood estimates, although it may be based on a numerical * estimate rather than an analytic one. * * Now calculate the three forms of the asymptotic variance of Beta (16-20) * as in the textbook. * First, that based on the expectation of the Hessian (16-16). GENR EY=BETA+X GENR V1=-1/(BETA+X)**2+2*EY/(BETA+X)**3 * Second, that based on the actual value of the Hessian (16-17). GENR V2=-1/(BETA+X)**2+2*Y/(BETA+X)**3 * Third, that based the outer product of the gradient (16-18). GENR V3=(-1/(BETA+X)+Y/(BETA+X)**2)**2 * Sum these values, and invert. ?STAT V1-V3 /SUMS=VARINV MATRIX VAR=1/VARINV * Print the three estimates. PRINT VAR * STOP * *=============================================================================== * * Updated October 30, 2008