Learn R Programming

spdep (version 0.5-3)

GMerrorsar: Spatial simultaneous autoregressive error model estimation by GMM

Description

An implementation of Kelejian and Prucha's generalised moments estimator for the autoregressive parameter in a spatial model.

Usage

GMerrorsar(formula, data = list(), listw, na.action = na.fail,
 zero.policy = NULL, return_LL = FALSE, method="nlminb", 
 control = list(), pars, verbose=NULL, sparse_method="Matrix",
 returnHcov=FALSE, pWOrder=250, tol.Hcov=1.0e-10)
## S3 method for class 'gmsar':
summary(object, correlation = FALSE, Hausman=FALSE, ...)

Arguments

formula
a symbolic description of the model to be fit. The details of model specification are given for lm()
data
an optional data frame containing the variables in the model. By default the variables are taken from the environment which the function is called.
listw
a listw object created for example by nb2listw
na.action
a function (default na.fail), can also be na.omit or na.exclude with consequences for residuals and fitted values - in these cases the weights list will be subsetted to remove NAs in the data. It may be necessary to
zero.policy
default NULL, use global option value; if TRUE assign zero to the lagged value of zones without neighbours, if FALSE (default) assign NA - causing GMerrorsar() to terminate with an error
return_LL
default FALSE, if TRUE, try to calculate the log likelihood of the function for the fitted model values --- see details
method
default "nlminb", or optionally a method passed to optim to use an alternative optimizer
control
A list of control parameters. See details in optim or nlminb.
pars
starting values for $\lambda$ and $\sigma^2$ for GMM optimisation, if missing (default), approximated from initial OLS model as the autocorrelation coefficient corrected for weights style and model sigma squared
verbose
default NULL, use global option value; if TRUE, reports function values during optimization.
sparse_method
default "Matrix", can also be "spam" to use spam package objects for finding the Jacobian
returnHcov
default FALSE, return the Vo matrix for a spatial Hausman test
tol.Hcov
the tolerance for computing the Vo matrix (default=1.0e-10)
pWOrder
default 250, if returnHcov=TRUE, pass this order to powerWeights as the power series maximum limit
object
gmsar object from GMerrorsar
correlation
logical; (default=FALSE), TRUE not available
Hausman
if TRUE, the results of the Hausman test for error models are reported
...
summary arguments passed through

Value

  • A list object of class gmsar
  • lambdasimultaneous autoregressive error coefficient
  • coefficientsGMM coefficient estimates
  • rest.seGMM coefficient standard errors
  • s2GMM residual variance
  • SSEsum of squared GMM errors
  • parametersnumber of parameters estimated
  • lm.modelthe lm object returned when estimating for $\lambda=0$
  • callthe call used to create this object
  • residualsGMM residuals
  • lm.targetthe lm object returned for the GMM fit
  • fitted.valuesDifference between residuals and response variable
  • formulamodel formula
  • aliasedif not NULL, details of aliased variables
  • zero.policyzero.policy for this model
  • LLlog likelihood value at computed optimum
  • vvlist of internal bigG and litg components for testing optimisation surface
  • optresobject returned by optimizer
  • parsstart parameter values for optimisation
  • HcovSpatial DGP covariance matrix for Hausman test if available
  • na.action(possibly) named vector of excluded or omitted observations if non-default na.action argument used

Details

When the control list is set with care, the function will converge to values close to the ML estimator without requiring computation of the Jacobian, the most resource-intensive part of ML estimation. For moderately sized data sets with hundreds of observations, but not many thousands, the Jacobian is computed once to give the likelihood of the fitted model, allowing a test against the model with no spatial dependence.

Note that the fitted() function for the output object assumes that the response variable may be reconstructed as the sum of the trend, the signal, and the noise (residuals). Since the values of the response variable are known, their spatial lags are used to calculate signal components (Cressie 1993, p. 564). This differs from other software, including GeoDa, which does not use knowledge of the response variable in making predictions for the fitting data.

References

Kelejian, H. H., and Prucha, I. R., 1999. A Generalized Moments Estimator for the Autoregressive Parameter in a Spatial Model. International Economic Review, 40, pp. 509--533; Cressie, N. A. C. 1993 Statistics for spatial data, Wiley, New York.

See Also

optim, nlminb, errorsarlm

Examples

Run this code
data(oldcol)
COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
 nb2listw(COL.nb, style="W"), method="eigen")
summary(COL.errW.eig, Hausman=TRUE)
COL.errW.GM <- GMerrorsar(CRIME ~ INC + HOVAL, data=COL.OLD,
 nb2listw(COL.nb, style="W"), returnHcov=TRUE)
summary(COL.errW.GM, Hausman=TRUE)
COL.errW.GM1 <- GMerrorsar(CRIME ~ INC + HOVAL, data=COL.OLD,
 nb2listw(COL.nb, style="W"))
summary(COL.errW.GM1)
example(NY_data)
esar1f <- spautolm(Z ~ PEXPOSURE + PCTAGE65P + PCTOWNHOME, data=nydata,
 listw=listw_NY, family="SAR", method="full")
summary(esar1f)
esar1gm <- GMerrorsar(Z ~ PEXPOSURE + PCTAGE65P + PCTOWNHOME,
 data=nydata, listw=listw_NY)
summary(esar1gm)
esar1gm1 <- GMerrorsar(Z ~ PEXPOSURE + PCTAGE65P + PCTOWNHOME,
 data=nydata, listw=listw_NY, method="Nelder-Mead")
summary(esar1gm1)

Run the code above in your browser using DataLab