Академический Документы
Профессиональный Документы
Культура Документы
Introduction
Estimation techniques
Diagnostics
x
i
_
cos
_
90
x
j
_
+
sin
_
90
x
i
_
sin
_
90
x
j
_
cos
_
90
x
i
_
cos
_
y
j
y
i
_
_
R is the radius of the earth, x and y are latitudes and longitudes
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Distance
Euclidean distance
d
1,2
=
_
(x
1
x
2
)
2
+ (y
1
y
2
)
2
1/p
where p is a constant that can have any value from 1 to
p = 1: Manhattan distance (road distance)
p = 2: Euclidean distance (shorter)
p can be estimated from a sample of road distances
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
GIS revolution and ESRI shapeles
spatial dependence
spatial heterogeneity
heteroskedasticity
Spatial spillover
Omitted variables
Solutions
Solutions
GIS :
maptools (R package)
S+Spatialstats (S-plus)
GeoBugs (http://www.mrc-
bsu.cam.ac.uk/bugs/winbugs/geobugs.shtml)
STARS
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Motivating Example: Ertur C. and Koch W. (2007)
k
it
L
1
k
it
withA
i
the aggregate level of technology
A
it
=
t
k
it
N
j =i
A
w
ij
jt
t
= (0) e
t
: exogenous technological progress
it
: technological externalities among rms within a region
j =i
A
w
ij
jt
: spatial technological externalities ( reects the
degree of spatial externalities)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Motivating Example: Ertur C. and Koch W. (2007)
y
= D ln y
0
+ DW ln y
0
+ DX + DWX + DW
y
+
X =
_
c ln s
k
ln (n + g + )
D = diag
_
1 e
i
t
_
is a diagonal matrix reecting the
specic eects of the convergence speed in each region
Introduction
Estimation techniques
Diagnostics
f
X
S
(X
S
; ) represents the joint probability density function of
an ordered sequence of random variables {X
S
|s S} called
spatial random processes or random elds
k -Nearest neighbours
Two sites s
i
and s
j
are said to be neighbours if 0 d
ij
d
with
d
ij
the appropriate distance adopted and d
representing the
critical cut-o
Two sites s
i
and s
j
are said to be neighbours if d
ij
min d
ik
k
This criterion ensures that each observation has exactly the same
number (k) of neighbours
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Contiguity based neighbourhood
Two sites s
i
and s
j
are said to be neighbours if they share a
common boundary
w
ij
= 1 for i and j neighbours
w
ij
= 0 otherwise
0 1 0 0
1 0 1 0
0 1 0 1
0 0 1 0
W
=
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Binary spatial weights matrix-Row standardization
w
s
ij
= w
ij
/
j
w
ij
s.t.
j
w
s
ij
= 1
0 1 0 0
1 2 0 1 2 0
0 1 2 0 1 2
0 0 1 0
W
=
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Binary spatial weights matrix
Cli and Ord (1981) suggest to use the length of the common
border between contiguous regions, weighted by a distance function:
w
ij
=
_
d
ij
a
_
ij
b
d distance between (centroids of) spatial units i and j
share of common boundary between i and j (reects the
intensity of the relationship)
a and b parameters estimated from data or chosen a priori
w
ij
=
_
d
ij
a
: gravitational-type weighting
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Alternative notions of proximity
1 2
2 1 3
3 2 4
4 3
0 1 0 0
1 2 0 1 2 0
1 2 1 2
0 1 2 0 1 2
1 2 1 2
0 0 1 0
ij
s s
j
j
y y
y y y
w y
y y y
y y
W y
W
s
= raw standardized matrix
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Spatial autocorrelation statistics
Alternative Hypotheses
Morans (1950) I
Gearys (1954) c
Local G
j
w
ij
_
_
j
w
ij
(x
i
x) (x
j
x)
i
(x
i
x)
2
_
Where the data are distributed such that high and low values are
generally located near each other, the data are said to exhibit
negative spatial autocorrelation
j
w
ij
_
_
j
w
ij
(x
i
x
j
)
2
i
(x
i
x)
2
_
c is more sensitive to |x
i
x
j
|, while I is more sensitive to extreme
x-values
Var ()
The expected value and variance of the Moran I for samples of size
N could be calculated according to the assumed pattern of spatial
data distribution and the normal test for the null hypothesis of no
spatial autocorrelation between observed values over the N locations
can be conducted based on the standardized Moran I
j
(w
ij
+ w
ji
)
2
S
2
=
i
_
j
w
ij
+
j
w
ji
_
2
Cli and Ord (1981) nd that with a large number of places, the
normal approximation is usually accurate and is of practical value in
testing the signicance of departure from the null hypothesis
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Inference on Morans I under randomization
E (I ) =
1
N1
Var (I ) =
NS
4
S
3
S
5
(N1)(N2)(N3)
(
i
j
w
ij )
2
S
1
=
1
2
j
(w
ij
+ w
ji
)
2
S
2
=
i
_
j
w
ij
+
j
w
ji
_
2
S
3
=
N
1
i
(x
i
x)
4
(
N
1
i
(x
i
x)
2
)
2
S
4
=
_
N
2
3N + 3
_
S
1
NS
2
+ 3
_
j
w
ij
_
2
S
5
= S
1
2NS
1
+ 6
_
j
w
ij
_
2
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Inference on Morans I
The questions raised by this procedure are how large does N have
to be? and how well does the assumption of asymptotic normality
hold even if N is large?
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Interpretation of Morans I
j
(w
ij
+ w
ji
)
2
S
2
=
i
_
j
w
ij
+
j
w
ji
_
2
Z =
c E (c)
_
Var (c)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Inference on Gearys c under randomization
E (c) = 1
Var (c) = (N 1) S
1
_
N
2
3N + 3 (N 1) S
3
(1/4) (N 1) S
2
_
N
2
+ 3N 6
_
N
2
N + 2
_
S
3
+
_
j
w
ij
_
2
_
N
2
3 (N 1)
2
S
3
_
/
N (N 1) (N 2)
_
j
w
ij
_
S
3
=
N
1
i
(x
i
x)
4
(
N
1
i
(x
i
x)
2
)
2
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Interpretation of Gearys c
j
w
ij
(d) x
i
x
j
/
j
x
i
x
j
Var (G)
For some statistics, such as the sample mean and OLS parameter
estimates, the theoretical distributions are well known and can, in
most circumstances, be used with condence that the assumptions
concerning the distributions are met
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Limit of the classical statistical inference
Four steps:
1) calculate I for the observed distribution of x and call this I
2) randomly reassign the N data values across the N spatial units
3) calculate I for the new spatial distribution of x and store
4) repeat steps 2 and 3 many times (at least 99 time and preferably
999 time)
yields an
estimate of the probability that a value of Morans I as high as I
i
(x
i
x)
2
/N
E (I
i
) = w
i .
/ (N 1) w
i .
=
j
w
ij
j = i
Var (I
i
) = w
2
i .
V
where V is the variance of I under randomization
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Local Morans I
Anselin, L. 1995. Local indicators of spatial association,
Geographical Analysis, 27, 93115
Anselin, L. 1996. The Moran scatterplot as an ESDA tool
to assess local instability in spatial association. pp. 111125 in
M. M. Fischer, H. J. Scholten and D. Unwin (eds) Spatial
analytical perspectives on GIS, London, Taylor and Francis
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Moran scatterplot
Four quadrants:
high-high, low-low = spatial cluster
high-low, low-high = spatial outliers
Morans I
Slope of linear scatterplot smoother
j
w
ij
x
j
j
x
j
j = i
i
=
j
w
ij
x
j
j
x
j
i
where w
ii
must not equal zero
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Local G
The G
i
and the G
i
statistics are normally distributed
E (G
i
) = w
i .
/ (N 1) w
i .
=
j
w
ij
j = i
Var (G
i
) = w
i .
(N 1 w
i .
) s
2
i
/ (N 1)
2
(N 2) x
2
i
E (G
i
) = w
i .
/N w
i .
=
j
w
ij
i
Var (G
i
) = w
i .
(N w
i .
) s
2
i
/N
2
(N 1) x
2
i
where s
2
i
is the sample estimate of the variance of x, again
excluding the value i
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Local G
The G
i
values are computed around each observation as distance
increases
A random eld {X
S
|s S} is stationary (in a strict sense) if the
DGP of the realizations remains constant over space, that is if
s S the joint pdf f (X
S
, s S) does not change when the
subset is shifted in the space
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Rotation and translation
A random eld {X
S
|s S} is said to be stationary of order k if
s S the moments of order k of its joint pdf f (X
S
, s S) do
not change when the subset is subject to translations or rotations
A random eld {X
S
|s S}which is stationary up to the second
order is said to be ergodic if
lim
d
ij
d
ij
(s
i
, s
j
) = 0
i
x
i
p
N
1
i
(x
i
)
2
p
2
1
N(N1)
j
(xi ) (x
j
)
p
(d
ij
)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Ergodicity
Position indices: mean (m), median (Q2), rst and third quartiles
(Q1 and Q3)
RADVIZ method
Projection Pursuit
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using the R software: download the libraries (packages)
library(car); library(lmtest); library(tseries);
library(lawstat)library(nortest);library(mvnormtest); library(sandwich)
library(quantreg);library(faraway);library(eects) library(leaps);
library(foreign);library(hett) library(ellipse);library(nlme);library(calibrator)
library(Matrix);library(spdep);library(corpcor)
library(labstatR);library(gap);library(strucchange); library(maptools);
library(gstat); library(spdep) library(spectralGP);
library(lattice);library(GeoXp);library(boot)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R: set up working directory and Read shapele
setwd(C:/MASTER/SpatEcon/DataShapeFilesMatrices/Europe/NUTS2)
EUselected1 < readShapePoly(EUselected1,IDvar=Id)
plot(EUselected1)
title(main=Western Europe NUTS2 regions)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R: Get spatial coordinates and Plot maps
coord.b < coordinates(EUselected1)
names(EUselected1)
source(quantile.map.R)
gprb < EUselected1$gprb*100
Quantile.map(shape=EUselected1,var=gprb,levels=5,
custom title=growth rate)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R: choroplet map
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R: Spatial weights matrices and spatial lags
# Neighbourhood proximity by distance
# Compute the minimum threshold distance
k1 < knn2nb(knearneigh(coord.b,k=1,longlat=T))
all.linkedT < max(unlist(nbdists(k1,coord.b,longlat=T))); all.linkedT
# The minimum threshold distance is 320 km
# Increasing the cut-o distance
dnb320 < dnearneigh(coord.b, 0, 321,...)
...
dnb1020 < dnearneigh(coord.b, 0, 1020,...)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R: Row-standardization
dnb320.listw < nb2listw(dnb320,style=W)
....
dnb1020.listw < nb2listw(dnb1020,style=W)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R: Morans I test
growth < EUselected1$gprb
moran.test(growth, dnb320.listw,randomisation=T,
alternative=greater)
...
moran.test(growth,
dnb720.listw,randomisation=T,alternative=greater)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R: Morans I test under randomisation
data: growth
weights: nb2listw(dnb720, style = W)
Moran I statistic standard deviate = 13.8164, p-value < 2.2e-16
alternative hypothesis: greater
sample estimates:
Moran I statistic Expectation Variance
0.2024500046 -0.0052910053 0.0002260749
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Course content
Introduction
Estimation techniques
Diagnostics
Spatial externalities
Omitted variables
Unobserved heterogeneity
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Spatial externalities
Vector form
y
i
= +
k
x
ik
k
+
i
i = 1, ..., N (location)
i
iid
_
0,
2
_
Var (
i
|X) =
2
E
_
= 0 i = j
Matrix form
y = i
N
+ X +
E [] = 0 E
_
_
=
2
I
N
OLS
unbiased and ecient (BLUE)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Linear regression model with a spatial autoregressive
disturbance (SEM)
Structural form
y = i
N
+ X + = W + u u iidN
_
0,
2
I
N
_
y
i
= +
k
x
ik
k
+
i
i
=
j
w
ij
j
+u
i
u
i
iid
_
0,
2
_
=
2
I
N
E
_
=
2
_
(I
N
W)
1
_
I
N
W
_
1
_
= 0
=
2
_
I
N
+ W + W
+
2
_
W
2
+WW
+W
2
_
+...
_
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Interpretation of SEM
Assume
y = x + z
non-spherical disturbances
OLS
still unbiased but not ecient
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Unobserved heterogeneity and SEM
Assume
y = a + X
N
_
0,
2
I
N
_
y = x + (I
N
W)
1
Assume again
y = x + z
OLS
biased and not ecient
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Unobserved heterogeneity and SDM
Again assume
y = a + X
What if a is not independent of X ?
Suppose
= X +
N
_
0,
2
I
N
_
a = Wa + = Wa + X + = (I
N
W)
1
X + (I
N
W)
1
y = x + (I
N
W)
1
(X + )
y = Wy + X ( + ) + WX () + = Wy +
1
x +
2
Wx + u
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Spatial lag model (SLM)
Structural form
y = Wy + X + u
u N(0,
2
u
I
N
)
y
i
=
j
w
ij
y
j
+x
i
+ u
i
u
i
N(0,
2
u
)
Reduced form
y = (I
N
W)
1
(X) + (I
N
W)
1
u
E[y|X] = (I
N
W)
1
X
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Interpretation of the SLM
Structural form
y = W
1
y + i
N
+ X +
= W
2
+ u
u N
_
0,
2
I
N
_
Reduced form
y = (I
N
W
1
)
1
(X + i
N
) + (I
N
W
1
)
1
(I
N
W
2
)
1
u
(I
N
W
1
)
1
(X + i
N
) : familiar spatial multiplier in X
(I
N
W
1
)
1
(I
N
W
2
)
1
u (hard to interpret)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Spatial cross-regressive model
y = X + WX + u
k
E [y
i
] /X
jk
= 0
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Direct and indirect eects in SDM
k
+ W
k
_
=
k
+ W
r
_
= 0
where (I
N
W)
1
ij
represents the ij th element of the matrix
(I
N
W)
1
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Summary measures of impacts (Pace and LeSage, 2009)
SDM
Average total impact (M
k
tot
) N
1
i
N
(I
N
W)
1
_
I
N
k
+W
k
_
i
N
Average direct impact (M
k
dir
) N
1
tr
_
(I
N
W)
1
ii
_
I
N
k
+W
k
__
Average indirect impact (M
k
ind
) M
k
ind
= M
k
tot
M
k
dir
SLM
Average total impact (M
k
tot
) (1 )
1
k
Average direct impact (M
k
dir
) N
1
tr
_
(I
N
W)
1
ii
I
N
k
_
Average indirect impact (M
k
ind
) M
k
ind
= M
k
tot
M
k
dir
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Inference on impact measures
- Ecient simulation approaches can be used to produce an empirical
distribution of the paramerters , , , ,
2
that are needed to
calculate the scalar summary measures
- This distribution can be constructed using a large number of
simulated parameters drawn from the multivariate distribution of
the parameters implied by the ML estimates
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Interpretation
- If
k
= 0.5 and M
k
dir
= 0.586 , we say that there is a positive
feedback eect equal to 0.086 arising from impacts passing through
neighboring regions and back to the region itself
- If M
k
ind
= 0.243 , we say that there is a positive positive and
signicant spillover eect arising from changes in the variable X
k
- If the model is specied in logged levels, we can interpret the
impacts estimates as elasticities. Thus, we would conclude that a
10% increase in X
k
would result in a 8.29% increase in y . Around
7/10 of this impact comes from the direct eect magnitude of
0.586, and 3/10 from the indirect or spatial spillover impact based
on its scalar impact estimate of 0.243
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Course content
Introduction
Estimation techniques
Diagnostics
Assume
i
iidN
_
0,
2
I
N
_
; for each observation i the density is
f (
i
) =
1
2
exp
_
2
i
2
2
_
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
A digression on Maximum Likelihood
i =1
1
2
exp
_
2
i
2
2
_
2
(2)
N/2
exp
_
2
2
_
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
A digression on Maximum Likelihood
In logs
ln L
_
,
2
_
=
N
2
log
_
2
2
_
1
2
2
_
_
ln L
_
,
2
_
=
N
2
log (2)
N
2
log
2
1
2
2
_
_
ln L
_
,
2
_
=
N
2
log (2)
N
2
log
2
1
2
2
_
y
y 2
y +
X
_
ML
=
_
X
X
_
1
X
Having found
ML
, we get
ln L
_
,
2
_
=
N
2
log (2)
N
2
log
2
1
2
2
_
y
y 2
y +
_
ln L
_
,
2
_
=
N
2
log (2)
N
2
log
2
1
2
2
_
_
ln L
_
,
2
_
=
N
2
log (2)
N
2
log
2
1
2
2
RSS
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
A digression on Maximum Likelihood
Now
ln L
_
,
2
_
2
= 0 =
2
= RSS/N = RSS/ (N k)
(in small sample
2
ML
is biased downward)
= 0 (score
vector)
Consistency: p lim
ML
= or lim
N
Pr
_
ML
_
= 0
Asymptotic eciency :
ML
is asymptotically ecient, as its variance
achieves the Cramer-Rao lower bound for consistent estimators
(thus, the ML estimator has the strong attraction of having the
smallest asymptotic variance among root-N consistent estimators)
[I ()]
1
=
_
E
_
2
ln L
__
1
I is the expected Fisher information
matrix
Asymptotic normality:
ML
N
_
, [I ()]
1
_
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Asymptotic covariance matrix of MLE
2
ln L
__
1
can be evaluated at
to estimate the covariance matrix for the ML
estimator
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
ML estimator for SLM with exogenous variables
y = Wy + X + iidN
_
0,
2
I
N
_
= y Wy X
+ ln |I
N
W|
1
2
2
_
(y Wy X)
(y Wy X)
ML
() =
_
X
X
_
1
X
(I
N
W) y
=
_
X
X
_
1
X
y
_
X
X
_
1
X
Wy
= b
0
b
L
b
0
=
_
X
X
_
1
X
y
b
L
=
_
X
X
_
1
X
Wy
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
ML estimator for SLM with exogenous variables
2
ML
() =
1
N
_
y Wy X
ML
()
_
_
y Wy X
ML
()
_
=
1
N
(e
0
e
L
)
(e
0
e
L
)
=
1
N
y
(I
N
W)
M (I
N
W) y
M = I
N
X
_
X
X
_
1
X
(e
0
e
L
)
N
_
=
N
2
ln [2] +
N
i =1
(I
i
)
N
2
ln
_
1
N
y
(I W)
M (I W) y
_
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
ML estimator for SLM with exogenous variables
(I
N
W)
M (I
N
W) y
|I
N
W|
2/N
_
0
e
0
2e
0
e
L
+
2
e
L
e
L
i
(I
N
i
)
_
min
,
1
max
_
. This requires that we constrain
our optimisation search to values of within that range
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
ML estimator for SLM with exogenous variables
ML
=
_
X
X
_
1
X
(I
N
W) y
=
_
X
X
_
1
X
y
_
X
X
_
1
X
Wy
= b
0
b
L
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Steps for the ML estimation of the SLM
2) Compute residuals e
0
= y X
0
and e
L
= Wy X
3) Given e
0
and e
L
, nd that maximizes the concentrated
likelihood function
lnL(y|) =
N
2
ln [2] +
i
(I
N
i
)
N
2
ln
_
(e
0
e
L
)
(e
0
e
L
)
N
_
L
and
2
=
(e
0
e
L
)
(e
0
e
L
)
N
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Inference
SDM : y = X + WX + Wy +
Specication:
y = X +
= W + u
u iidN
_
0,
2
I
N
_
= (I
N
W)
1
u
=
2
1
= (I
N
W)
(I
N
W)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
ML estimator for the SEM
Thus, although
OLS
retains its unbiasedness, inference based on
the usual variance estimate may be misleading
GLS
=
_
X
(I
N
W)
(I
N
W) X
_
1
X
(I
N
W)
(I
N
W) y
Var
_
GLS
_
=
2
GLS
_
X
(I
N
W)
(I
N
W) X
_
1
2
GLS
= N
1
_
_
y X
GLS
_
_
y X
GLS
_
_
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
ML estimator for the SEM
OLS
_
on We
OLS
2
_
+ln |I
N
W|
1
2
2
_
(y X)
()
1
(y X)
_
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
ML estimator for the SEM
The GLS results for and Var () are also ML. Thus, we can use
them to compute the concentrated log-likelihood as a nonlinear
function of the autoregressive parameter
ln L (y|) =
N
2
ln [2] +
N
i =1
(I
N
i
)
N
2
ln
_
e
GLS
(I
N
W)
(I
N
W) e
GLS
_
e
GLS
= y X
GLS
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Iterative approach to estimate the SEM
(1)
=
_
X
X
_
1
X
y u
(1)
= y X
(1)
(I
N
W)
(I
N
W) u
_
+
i
(I
N
i
)
FGLS
=
_
X
_
I
N
W
_ _
I
N
W
_
X
_
1
X
_
I
N
W
_ _
I
N
W
_
y
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Iterative approach to estimating the SEM
(step k)
(step k1)
and
(step k)
(step k1)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Nonparametric covariance matrix estimator
Structural model
y = Wy + X +
=
_
Z
Z
_
1
Z
Wy
Wy = HWy H = Z
_
Z
Z
_
1
Z
Q =
_
X,
Wy
_
y =
Q +
=
_
Q
_
1
y
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
IV-2SLS estimator for the SLM
Structural form
y = Wy + X +
= W + u
Variance-covariance matrix:
= E
_
_
=
2
u
(I
N
W)
1
(I
N
W)
1
Let Z =
_
X, WX, W
2
X, ...
_
the matrix of instruments
Third step
= Q
+ u
y
= y
Wy
Q
= Q
WZ
=
_
Q
_
Q
_
_
_
1
Q
_
y
_
_
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
A list of references for 2SLS and GMM approaches to SLM
Das, D., Kelejian, H.H., Prucha, I.R., 2003. Small sample properties
of estimators of spatial autoregressive models with autoregressive
disturbances. Papers in Regional Science 82, 126
Lee, L.F., 2003. Best spatial two-stage least squares estimators for
a spatial autoregressive model with autoregressive disturbances.
Econometric Reviews 22, 307335
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Course content
Introduction
Estimation techniques
Diagnostics
With W standardized
I =
e
We
e
e
where e is a vector of OLS residuals
Cli and Ord (1972, 1973, 1981) show that the asymptotic
distribution for Morans I based on least-squares residuals
corresponds to a standard normal distribution after having
standardized the I-statistic
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Morans I test of spatial autocorrelation in OLS residuals
W standardized
E [I ] = tr (MW) / (N k)
V [I ] =
tr (MWMW
) + tr (MW)
2
+ [tr (MW)]
2
(N k) (N k 2)
{E [I ]}
2
z [I ] =
I E (I )
_
V [I ]
Under H
0
, z
a
N (0, 1)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Likelihood-based tests
ML Tests against spatial error
Wald (W)
Requirements
Dene
=
max L () under the restrictions
max L () without the restrictions
< 1
If H
0
: =
0
is not valid, will be signicantly 1
If H
0
: =
0
is valid, will be close to 1
Under H
0
, LR
a
2
1
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Wald test
0
_
is signicant. If H
0
: = 0
W =
V
__
__
= z
2
Under H
0
, W
a
2
1
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Lagrange Multiplier test
(
0
) I (
0
)
1
S
(
0
)
Under H
0
, LM
a
2
1
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
LM-error
H
0
: no spatial autocorrelation ( = 0)
H
1
: spatial error model ( = 0)
LM
err
=
_
e
We/
2
_
2
/T
where e denotes least-squares residuals and
T = tr (WW) + (W
W)
LM
err
and the square of Morans I are asymptotically equivalent
Under H
0
, LM
a
2
1
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Wald and Likelihood ratio tests (SEM vs OLS)
Under H
0
, W and LR
a
2
1
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
LM-lag test statistic
H
0
: no spatial autocorrelation ( = 0)
H
1
: spatial lag model ( = 0)
LM
lag
=
_
e
Wy/
2
_
2
/R
R =
_
WX
M
_
WX
_
/
2
OLS
+ tr
_
WW + W
W
_
Under H
0
, LM
a
2
1
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Wald and likelihood ratio tests (SLM vs OLS)
Under H
0
, LR
a
2
1
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Specication-robust LM tests
Local misspecication
LM
err
and LM
lag
are no longer
2
1
under H
0
in the
presence of local misspecication in the form of the other type
of spatial dependence
=
_
d
T
2
C
1
d
2
/
_
T
_
1 T
2
C
_
=
_
d
2
/
_
C/
2
T
C =
_
WX
M
_
WX
_
+T
2
d
= tr (I
N
W)
1
W +e
We/
2
score of the ML of the SEM
d
= tr (I
N
W)
1
W +e
We/
2
score of the ML of the SLM
Interpretation
LM
err
and LM
lag
are often both highly signicant
None signicant
Error model
lag model
We/
2
_
2
[T T
A
var ()]
1
T = tr
_
WW + W
W
_
T
A
= tr
_
_
WW + W
W
_
(I W)
1
_
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
LM lag test in spatial error model
Dene
B = (I
N
W) and e = ML residuals
H
p
=
tr (WW) + tr
_
BWB
1
_
BWB
1
+ [BWXb]
[BWXb] /
2
=
_
(BX)
BWX
/
2
, tr
_
WB
1
_
BWB
1
+ trWWB
1
, 0
_
LM
|
=
_
e
BWy
_
2
_
H
p
H
var () H
_
1
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Example: Regional Economic Growth in Europe
Mankiw et al. (1992)
y
= ln y
0
+ X +
y
: Productivity growth rate
ln y
0
: initial labour productivity
X : vector of structural variables (includes also a constant term)
: vector of iidN errors
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Example: Regional Economic Growth in Europe
y
= ln y
0
+ W ln y
0
+ X + WX + W
y
+
Reduced form:
y
= (I
N
W)
1
ln y
0
+ (I
N
W)
1
W ln y
0
+ (I
N
W)
1
X + (I
N
W)
1
WX + (I
N
W)
1
y
= ln y
0
+ X +
= W + v v iidN
_
o,
2
v
I
N
_
Reduced form:
y
= ln y
0
+ X + WX + (I
N
W)
1
v
y
= ln y
0
W ln y
0
+ X WX + W
y
+ v
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Example: Regional Economic Growth in Europe
printCoefmat(tres)
Statistic df p-value
LMerr 15.43620 1.00000 0.0001
LMlag 4.22923 1.00000 0.0397
RLMerr 12.16501 1.00000 0.0005
RLMlag 0.95803 1.00000 0.3277
SARMA 16.39423 2.00000 0.0003
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R functions: Spatial Durbin model (ML estimates)
The choice of the spatial weight matrix to estimate the SDM: model
uncertainty
Base the choice on the value of the AIC
SDM320 < lagsarlm(formula(LinearSolow),listw=dnb320.listw,
type=mixed,method=eigen,data=EUselected1)
...
SDM1020 < lagsarlm(formula(LinearSolow),listw=dnb1020.listw,
type=mixed,method=eigen,data=EUselected1)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R functions
summary(SDM420, correlation=F)
Estimate Std. Error z value Pr(> |z|)
(Intercept) -2.770 78.2676 -0.0354 0.9717645
log(pr80b) -159.016 18.5123 -8.5898 < 2.2e-16
lninv1b 1.973 3.1674 0.6232 0.5331778
lnagrib -12.413 3.7957 -3.2703 0.0010742
lndens emp 9.981 4.3459 2.2968 0.0216307
lag.log(pr80b) 95.960 27.8844 3.4414 0.0005788
lag.lninv1b 18.669 9.7521 1.9144 0.0555658
lag.lnagrib 1.3004 9.5782 0.1358 0.8920039
lag.lndens emp -2.6614 11.9504 -0.2227 0.8237680
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R functions
Rho: 0.36116, LR test value: 5.2777, p-value: 0.0216
Asymptotic standard error: 0.14576 z-value: 2.4777, p-value:
0.013222
Wald statistic: 6.1392, p-value: 0.013222
Log likelihood: -989.6833 for mixed model
ML residual variance (sigma squared): 1938.6, (sigma: 44.03)
LM test for residual autocorrelation test value: 0.00069044, p-value:
0.97904
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R functions: Compute average direct and indirect
eects
W < as(as dgRMatrix listw(dnb420.listw),CsparseMatrix)
trMatc < trW(W, type=mult)
trMC < trW(W, type=MC)
SDM420.impact < impacts(SDM420, tr=trMatc,R=200)
summary(SDM420.impact, zstats=TRUE, short=TRUE)
Estimate Direct Indirect Total
log(pr80b) -1.590 -1.578 0.591 -0.987
lninv1b 0.020 0.026 0.297 0.323
lnagrib -0.124 -0.125 -0.049 -0.174
lndens emp 0.100 0.100 0.014 0.115
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R functions: Spatial lag model (Maximum likelihood
estimates
SAR420 < lagsarlm(formula(LinearSolow), listw=dnb420.listw,
type=lag, method=eigen,data=EUselected1)
summary(SAR420, correlation=F)
Estimate Std.Error z value Pr(< |z|)
(Intercept) -14.317 24.212 -0.591 0.554
log(pr80b) -103.731 14.662 -7.074 1.498e-12
lninv1b 7.535 2.972 2.534 0.011
lnagrib -9.543 3.633 -2.627 0.008
lndens emp 6.245 4.246 1.470 0.141
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R functions: Spatial lag model (Maximum likelihood
estimates
Rho: 0.19951, LR test value: 3.1106, p-value: 0.077785
Asymptotic standard error: 0.12323
z-value: 1.619, p-value: 0.10544
Wald statistic: 2.6213, p-value: 0.10544
Log likelihood: -998.527 for lag model
ML residual variance (sigma squared): 2143.2, (sigma: 46.295)
AIC: 2011.1, (AIC for lm: 2012.2)
LM test for residual autocorrelation test value: 6.7246, p-value:
0.0095091
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R functions: Compare SDM and SAR
LR.sarlm(SDM420,SAR420)
Likelihood ratio = 17.6873, df = 4, p-value = 0.00142
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R functions: Spatial Error model (ML estimates)
error420 < errorsarlm(formula=formula(LinearSolow),
listw=dnb420.listw,method=eigen,data=EUselected1)
summary(error420)
Estimate Std.Error z value Pr(> |z|)
(Intercept) -12.685 23.8353 -0.5322 0.594591
log(pr80b) -136.840 13.6350 -10.0360 2.2e-16
lninv1b 4.066 3.0909 1.3156 0.188311
lnagrib -10.787 3.7492 -2.8773 0.004011
lndens emp 8.4469 4.2607 1.9825 0.047421
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R functions: Spatial Error model (ML estimates)
Lambda: 0.52865, LR test value: 12.024, p-value: 0.00052526
Asymptotic standard error: 0.12109
z-value: 4.3659, p-value: 1.2662e-05
Wald statistic: 19.061, p-value: 1.2662e-05
Log likelihood: -994.0704 for error model
ML residual variance (sigma squared): 2002.2, (sigma: 44.746)
AIC: 2002.1, (AIC for lm: 2012.2)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Using R functions: Common factor test
LR.sarlm(SDM420,error420)
Likelihood ratio = 8.7741, df = 4, p-value = 0.067
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Course content
Introduction
Estimation techniques
Diagnostics
Global model:
y
i
= + x
1i
+... + x
mi
+
i
i is a point in space or a region
i
=
0
+
1
n
i
+
2
e
i
i
=
0
+
1
n
i
+
2
e
i
...
i
=
0
+
1
n
i
+
2
e
i
where n
i
(northing) and e
i
(easting) are the spatial coordinates of
location i
y
i
=
0
+
1
n
i
+
2
e
i
+
0
x
1i
+
1
n
i
x
1i
+
2
e
i
x
1i
+... +
0
x
mi
+
1
n
i
x
mi
+
2
e
i
x
mi
+
i
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Spatial expansion (trend surface)
Marginal eects:
y
x
1
=
0
+
1
n +
2
e
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Limitations of the spatial expansion method
Global model
y
i
= a
0
+
k
x
ik
+
i
i : a point in space or a region
OLS estimation:
=
_
X
X
_
1
X
k
(n
i
, e
i
) x
ik
+
i
where (n
i
, e
i
) denotes the coordinates of the i -th point in space,
k
(n
i
, e
i
) is a realization of the continuous function
k
(n, e) at
point i
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
GWR
Let
=
_
0
(n
1
, e
1
)
1
(n
1
, e
1
)
K
(n
1
, e
1
)
.
.
.
.
.
.
.
.
.
.
.
.
0
(n
n
, e
n
)
1
(n
n
, e
n
)
K
(n
n
, e
n
)
_
_
be the matrix of the local parameters. Each row is estimated by
(i ) =
_
X
T
W (i ) X
_
1
X
T
W (i ) y
where
W (i ) = diag [w
i 1
, w
i 2
, ..., w
in
]
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
GWR
Gaussian weights
w
ij
= exp
_
d
2
ij
/h
2
_
i =1
_
y
i
y
=i
(h
i
)
2
where y
=i
(h
i
) is the tted value of y
i
with the observations for
point i omitted from the calibration process
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
A critical point
+ f
1
(x
1i
) + f
2
(x
2i
) + f
3
(x
3i
, x
4i
) +
Wy
i
+ f
4
(n
i
, e
i
) + ... +
i
A plot of f
4
(n
i
, e
i
) as a surface in the study area indicates spatial
trends in over- or under-prediction of the additive model
Wy
i
is endogeneous
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Semiparametric spatial additive models
i
+
i
has its antecedent in the interpretation of the 2SLS
estimator
2SLS
as the coecients on X
i
in a OLS regression of y
i
on X
i
and the residuals v
i
from a linear regression of X
i
on a set
of instruments Z
i
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Semiparametric spatial additive models
+ f
1
(x
1i
) + f
2
(x
2i
) + f
3
(x
3i
, x
4i
) +
Wy
i
+ f
4
(n
i
, e
i
) + f
5
( v
i
) + ... +
i
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
A list of papers on semiparamtric spatial models
Introduction
Estimation techniques
Diagnostics
it
+
it
i = 1,..., N spatial unit, t = 1,..., T time period,
One remedy:
i
capture the eect of the omitted variables
y
it
=
i
+x
it
+
it
j =1
w
ij
y
jt
+
i
+x
it
+
it
y
t
= Wy
t
+ + X +
t
E (
t
) = 0
E (
t
t
) =
2
I
N
Stability conditions
1/
min
< < 1/
max
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Fixed Eects Spatial Error Model
t
= W
t
+
t
E (
t
) = 0
E (
t
t
) =
2
I
N
Stability conditions
1/
min
< < 1/
max
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Fixed Eects Spatial Durbin Model
y
t
= Wy
t
+ + X
t
1
+ WX
2
+
t
E (
t
) = 0
E (
t
t
) =
2
I
N
2
= 0 SLM
2
+
1
= 0 SEM
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
ML estimator of spatial FE and RE models
2
, , ,
i
_
=
NT
2
ln
_
2
2
_
+ T ln (I W)
1
2
2
N
i =1
T
t=1
_
y
it
j =1
w
ij
y
jt
i
x
it
_
2
i
=
1
2
T
t=1
_
y
it
N
j =1
w
ij
y
jt
i
x
it
_
= 0
Thus, we obtain
i
=
1
T
T
t=1
_
y
it
N
j =1
w
ij
y
jt
x
it
_
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
FE-SLM
2
, ,
_
=
NT
2
ln
_
2
2
_
+ T ln (I W)
1
2
2
N
i =1
T
t=1
_
y
it
j =1
_
w
ij
y
jt
it
_
2
y
it
= y
it
y
i
_
w
ij
y
jt
= w
ij
y
jt
_
w
ij
y
j
it
= x
it
x
i
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
FE-SLM
Let b
0
and b
1
denote OLS estimators of regressing Y
and
(I
T
W) Y
on X
, and e
0
and e
1
the corresponding residuals.
The ML estimator of is obtained by maximizing the concentrated
log-likelihood function
ln L () = C + T ln (I W)
NT
2
ln
_
(e
0
e
1
)
(e
0
e
1
)
_
2
=
1
NT
(e
0
e
1
)
(e
0
e
1
)
2
, ,
_
=
NT
2
ln
_
2
2
_
+ T ln (I W)
1
2
2
N
i =1
T
t=1
_
y
it
N
j =1
[w
ij
y
jt
]
_
x
it
N
j =1
[w
ij
x
jt
]
_
2
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
FE-SEM
(I
T
W) X
[X
(I
T
W) X
]
_
1
[X
(I
T
W) X
] [Y
(I
T
W) Y
2
=
e()
e()
NT
where e() = Y
(I
T
W) Y
[X
(I
T
W) X
]
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
FE-SEM
e()
_
i
=
1
T
T
t=1
(y
it
x
it
)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Bias correction (Lee and Yu, 2010a)
If SLM, SEM and SDM contain spatial xed eects, but not time
xed eects, the error variance will be biased. This bias can be
easily corrected by
2
BC
=
T
T 1
If SLM, SEM and SDM contain time xed eects, but not spatial
xed eects, the error variance will be biased. This bias can be
easily corrected by
2
BC
=
N
N 1
If SLM, SEM and SDM contain both spatial and time xed eects,
other parameters (
, and
) need to be corrected too
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Diagnostics and model selection
j =1
w
ij
y
jt
+x
it
+ u
it
u
it
=
i
+
it
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
RE SEM
it
+ u
it
u
it
=
N
j =1
w
ij
u
jt
+
i
+
it
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
RE SLM
2
, , ,
_
=
NT
2
ln
_
2
2
_
+ T ln (I W)
1
2
2
N
i =1
T
t=1
_
y
it
N
j =1
[w
ij
y
jt
]
it
_
2
where y
it
= y
it
y
i
_
w
ij
y
jt
= w
ij
y
jt
w
ij
y
jt
x
it
= x
it
x
i
= 1
+T
2
= 1
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
RE SLM
Given , and
2
, the concentrated log-likelihood function of
takes the form
ln L () =
NT
2
ln
_
e()
e()
_
+
N
2
ln
2
2
, , ,
_
=
NT
2
ln
_
2
2
_
1
2
N
i =1
ln |V| + (T 1)
N
i =1
ln |B|
1
2
2
e
_
1
T
T
T
V
1
_
e
1
2
2
e
_
I
T
1
T
T
T
_
_
B
B
_
e
B = I
N
W
V = T
2
I
N
+
_
B
B
_
1
T
= (T 1) a vector of unit elements
e = y X
2
=
2
/
2
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
RE SEM
B
_
1
| =
i
ln
_
T +
1
(1
i
)
2
_
t
= By
t
+ [P B] y
X
t
= BX
t
+ [P B] X
with P = uppertriangular Choleski decomposition of
_
T
2
I
N
+
_
B
B
_
1
_
1
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
RE SEM
1
2
i
ln
_
1 + T (1
i
)
2
_
+T
i
ln (1
i
)
1
2
2
e
= (X
t
X
t
)
1
(X
t
y
t
)
2
= (NT)
1
T
t=1
e
t
e
Upon substituting
and
2
in the log-likelihood function, the
concentrated log-likelihood function of and
2
is obtained:
ln L
_
,
2
_
= C
NT
2
ln
_
T
t=1
e (, )
t
e (, )
t
_
1
2
N
i =1
ln
_
1 + T (1
i
)
2
_
+ T
N
i =1
ln (1
i
)
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
RE SEM
2
on the other, until convergence
Goodness of t
N
j =1
w
ij
y
j ,t
+
2
N
j =1
w
ij
y
j ,t1
+
K
k=1
2k
EX
ki ,t
+
Q
q=1
2q
EN
qi ,t
+
i
+
t
+
it
y
t
= y
t1
+
1
Wy
t
+
2
Wy
t1
+ EX
t
1
+ EN
t
2
+ +
t
+
t
2
)
max
< if
1
2
0
1 + (
1
2
)
min
< if
1
2
< 0
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
Dynamic spatial panel model
rsum
Note: the ratio between indirect and direct eects is the same
for every explanatory variables, both in the short term and in
the long term
[
(I
1
W)
1
(
1k
I )
]
rsum
[(I
1
W)
1
(
1k
I )]
d
=
[
(I
1
W)
1
]
rsum
[(I
1
W)
1
]
d
Roberto Basile Spatial Econometrics
Introduction
Notions of spatial statistics
Spatial econometrics: model specication
Estimation techniques
Diagnostics
(Spatially) varying parameters models
Spatial dependence in panel data models
An alternative specication
y
t
= y
t1
+ Wy
t
+ X
t
1
+ WX
t
2
+ +
t
+
t
rsum
Baltagi B.H., Song S.H. and Koh W. (2003), Testing panel data
regression models with spatial error correlation, Journal of
Econometrics, 117, 123-150
Baltagi, B.H., S.H. Song, B.C. Jung, and W. Koh (2007). Testing
for serial correlation, spatial autocorrelation and random eects
using panel data, Journal of Econometrics, 140, 551
Lee, L.F. and Yu, J. (2010c), A spatial dynamic panel data model
with both time and individual xed eects. Econometric Theory, 26,
564-597