CHAPTER 2. SPATIAL AUTOREGRESSIVE MODELS
on alternative optimization options. For example, the user might elect to
attempt a Davidson-Fletcher-Powell (`dfp') algorithmin place of the default
Broyden-Fletcher-Goldfarb-Smith (`bfgs') routine or supply starting values
for the parameters and .
With regard to optimization algorithm failures, it should be noted that
the Econometrics Toolbox contains alternative optimization functions that
can be used in place of maxlik. Any of these functions could be substituted
for maxlik in the function sac. Chapter 10 in the Econometrics Toolbox
provides examples of using these functions as well as their documentation.
The next section turns to illustrating the use of the estimation functions
we have constructed for the general spatial autoregressive model.
2.4.2 Applied examples
Our rst example illustrates the use of the general spatial model with the
Anselin Columbus neighborhood crime data set. We construct a matrix W
for use in the model based on W
W. To provide an illustration of
what this matrix inner product involving the rst-order contiguity matrix
W represents in terms of spatial structure, we use the spy function to pro-
duce comparative graphs of the two contiguity matrices that are shown in
Figure2.4. As we can see from the graphs, the inner product allows for a
more wide-ranging set of spatial inﬂuences reﬂecting secondary inﬂuences
not captured by the rst-order contiguity matrix. The sparse matrix litera-
ture refers to this phenomena where matrix products produce less sparsity as
\ll-in". The motivationfor this terminology shouldbe clear from the gure.
For another approach to producing \spatial lag" matrices, see the function
slag which represents a more appropriate way to create higher-order spatial
Our example illustrates the point discussed earlier regarding model spec-
ication with respect to the use of W and W
by producing estimates for
two models based on alternative congurations of these two spatial weight
matrices. We also produce estimates based on a model that uses the W
matrix for both the autoregressive lag and the autoregressive error terms.
% ----- Example 2.9 Using the sac function
% standardized 1st-order contiguity matrix
load anselin.dat; % load Anselin (1988) Columbus neighborhood crime data
y = anselin(:,1); nobs = length(y);
x = [ones(nobs,1) anselin(:,2:3)];
W = Wmat;
vnames = strvcat('crime','const','income','house value');
W2 = W'*W;