44
CHAPTER 2. SPATIAL AUTOREGRESSIVE MODELS
46
The motivation for the regression relationship is that population and
household density as well as unemployment rates work to determine the
house values in each county. Consider that the advent of suburban sprawl
and the notion of urban rent gradients suggests that housing values in con-
tiguous counties should be related. The least-squares relationship in (2.13)
ignores the spatial contiguity information whereas the SAR model would
allow for this type of variation in the model.
The rst task is to construct a spatial contiguity matrix for use with
our spatial autoregressive model. This could be accomplished by examin-
ing a map of the 88 counties and recording neighboring tracts for every
observation, a very tedious task. An alternative is to use the latitude and
longitude coordinates to construct a contiguity matrix. We rely on a func-
tion xy2cont that carries out this task. This function is part of Pace and
Barry's Spatial Statistics Toolbox for MATLAB, but has been modied to
t the documentation conventions of the spatial econometrics library. The
function documentation is shown below:
PURPOSE: uses x,y coord to produce spatial contiguity weight matrices
with delaunay routine from MATLAB version 5.2
------------------------------------------------------
USAGE: [w1 w2 w3] = xy2cont(xcoord,ycoord)
where:
xcoord = x-direction coordinate vector (nobs x 1)
ycoord = y-direction coordinate vector (nobs x 1)
------------------------------------------------------
RETURNS: w1 = W*W*S, a row-stochastic spatial weight matrix
w2 = W*S*W, a symmetric spatial weight matrix (max(eig)=1)
w3 = diagonal matrix with i,i equal to 1/sqrt(sum of ith row)
------------------------------------------------------
References: Kelley Pace, Spatial Statistics Toolbox 1.0
------------------------------------------------------
This function essentially uses triangles connecting the x-y coordinates in
space to deduce contiguous entities. As an example of using the function,
consider constructing a spatial contiguitymatrix for the Columbus neighbor-
hood crime data set where we know both the rst-order contiguity structure
taken from a map of the neighborhoods as well as the x-y coordinates. Here
is a program to generate the rst-order contiguity matrix from the latitude
and longitude coordinates and produce a graphical comparison of the two
contiguity structures shown in Figure2.3.
% ----- Example 2.5 Using the xy2cont() function
load anselin.data; % Columbus neighborhood crime
xc = anselin(:,5); % longitude coordinate
yc = anselin(:,4); % latitude coordinate