errorsarlm {spdep} | R Documentation

## Spatial simultaneous autoregressive error model estimation

### Description

Maximum likelihood estimation of spatial simultaneous autoregressive error models of the form:

y = X beta + u, u = lambda W u + e

where $λ$ is found by `optimize()` (prefered), or by `optim()` using method "L-BFGS-B" if argument optim=TRUE, first, and $β$ and other parameters by generalized least squares subsequently (one-dimensional search using optim performs badly on some platforms).

### Usage

    errorsarlm(formula, data=list(), listw, na.action=na.fail, method="eigen",
      quiet=TRUE, zero.policy=FALSE, interval = c(-1, 0.999), tol.solve=1.0e-10,
      tol.opt=.Machine$double.eps^0.5, control, optim=FALSE, cholAlloc=NULL)

### 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 set zero.policy to TRUE because this subsetting may create no-neighbour observations. Note that only weights lists created without using the glist argument to `nb2listw` may be subsetted.
`method` | "eigen" (default) - the Jacobian is computed as the product of (1 - rho*eigenvalue) using `eigenw`, and "SparseM" for strictly symmetric weights lists of styles "B", "C" and "U", or made symmetric by similarity (Ord, 1975, Appendix C) if possible for styles "W" and "S", using code from the SparseM package to calculate the determinant.
`quiet` | default=TRUE; if FALSE, reports function values during optimization.
`zero.policy` | if TRUE assign zero to the lagged value of zones without neighbours, if FALSE (default) assign NA - causing `errorsarlm()` to terminate with an error
`interval` | search interval for autoregressive parameter when not using method="eigen"; default is c(-1,1)
`tol.solve` | the tolerance for detecting linear dependencies in the columns of matrices to be inverted - passed to `solve()` (default=1.0e-10). This may be used if necessary to extract coefficient standard errors (for instance lowering to 1e-12), but errors in `solve()` may constitute indications of poorly scaled variables: if the variables have scales differing much from the autoregressive coefficient, the values in this matrix may be very different in scale, and inverting such a matrix is analytically possible by definition, but numerically unstable; rescaling the RHS variables alleviates this better than setting tol.solve to a very small value
`tol.opt` | the desired accuracy of the optimization - passed to `optim()` (default=square root of double precision machine tolerance, a larger root may be used if the warning: ERROR: ABNORMAL_TERMINATION_IN_LNSRCH is seen, see help(boston) for an example)
`control` | A list of control parameters passed to `optim`, se details in `optim`
`optim` | If TRUE use experimental `optim` branch and control argument
`cholAlloc` | control arguments for memory allocation in `chol` for sparse matrices in method="SparseM": if NULL, default values are used (larger than SparseM defaults), otherwise a list with elements: nsubmax, nnzlmax, and tmpmax, for example cholAlloc=list(nsubmax=25000, nnzlmax=100000, tmpmax=25000)

### Details

The asymptotic standard error of $λ$ is only computed when method=eigen, because the full matrix operations involved would be costly for large n typically associated with the choice of method="SparseM". The same applies to the coefficient covariance matrix. Taken as the asymptotic matrix from the literature, it is typically badly scaled, being block-diagonal, and with the elements involving lambda being very small, while other parts of the matrix can be very large (often many orders of magnitude in difference). It often happens that the `tol.solve` argument needs to be set to a smaller value than the default, or the RHS variables can be centred or reduced in range.

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.

### Value

A list object of class `sarlm`

`type` | "error"
`lambda` | simultaneous autoregressive error coefficient
`coefficients` | GLS coefficient estimates
`rest.se` | GLS coefficient standard errors (are equal to asymptotic standard errors)
`LL` | log likelihood value at computed optimum
`s2` | GLS residual variance
`SSE` | sum of squared GLS errors
`parameters` | number of parameters estimated
`lm.model` | the `lm` object returned when estimating for $λ=0$
`method` | the method used to calculate the Jacobian
`call` | the call used to create this object
`residuals` | GLS residuals
`lm.target` | the `lm` object returned for the GLS fit
`fitted.values` | Difference between residuals and response variable
`ase` | TRUE if method=eigen
`formula` | model formula
`se.fit` | Not used yet
`lambda.se` | if ase=TRUE, the asymptotic standard error of $λ$
`LMtest` | NULL for this model
`zero.policy` | zero.policy for this model
`na.action` | (possibly) named vector of excluded or omitted observations if non-default na.action argument used
`aliased` | if not NULL, details of aliased variables

The internal sar.error.* functions return the value of the log likelihood function at $λ$.

### Author(s)

Roger Bivand Roger.Bivand@nhh.no

### References

Cliff, A. D., Ord, J. K. 1981 Spatial processes, Pion; Ord, J. K. 1975 Estimation methods for models of spatial interaction, Journal of the American Statistical Association, 70, 120-126; Anselin, L. 1988 Spatial econometrics: methods and models. (Dordrecht: Kluwer); Anselin, L. 1995 SpaceStat, a software program for the analysis of spatial data, version 1.80. Regional Research Institute, West Virginia University, Morgantown, WV (www.spacestat.com); Anselin L, Bera AK (1998) Spatial dependence in linear regression models with an introduction to spatial econometrics. In: Ullah A, Giles DEA (eds) Handbook of applied economic statistics. Marcel Dekker, New York, pp. 237-289; Cressie, N. A. C. 1993 Statistics for spatial data, Wiley, New York.

### See Also

`lm`, `lagsarlm`, `eigenw`, `asMatrixCsrListw`, `similar.listw`, `predict.sarlm`, `residuals.sarlm`

### Examples

    data(oldcol)
    COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
     nb2listw(COL.nb, style="W"), method="eigen", quiet=FALSE)
    COL.errW.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
     nb2listw(COL.nb, style="W"), method="eigen", quiet=FALSE)
    COL.errB.eig <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
     nb2listw(COL.nb, style="B"), method="eigen", quiet=FALSE)
    COL.errW.SM <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
     nb2listw(COL.nb, style="W"), method="SparseM", quiet=FALSE)
    summary(COL.errW.eig, correlation=TRUE)
    summary(COL.errB.eig, correlation=TRUE)
    summary(COL.errW.SM, correlation=TRUE)
    NA.COL.OLD <- COL.OLD
    NA.COL.OLD$CRIME[20:25] <- NA
    COL.err.NA <- errorsarlm(CRIME ~ INC + HOVAL, data=NA.COL.OLD,
     nb2listw(COL.nb), na.action=na.exclude)
    COL.err.NA$na.action
    COL.err.NA
    resid(COL.err.NA)

[Package spdep version 0.3-25 Index]