---
title: Spatial Durbin Model (SDM) Overview
url: https://www.emergentmind.com/topics/spatial-durbin-models-sdm
type: topic
---

# Spatial Durbin Model (SDM) Overview

The Spatial Durbin Model (SDM) is a prominent specification in spatial econometrics and network analysis for modeling regional or networked data where an outcome in one location is affected not only by its own characteristics but also by interactions with neighboring units. The SDM explicitly incorporates endogenous spatial dependence (via lagged outcomes) and exogenous contextual dependence (via lagged covariates), enabling a rigorous decomposition of direct and spillover effects. Applied notably in the spatial analysis of morbidity and poverty in Thailand’s provinces, the SDM provides a framework to quantify the diffusion and contextual influence processes on spatial networks [2601.02848].

## 1. Mathematical Specification

The SDM is defined in matrix notation as:
\[
y = \rho W y + X \beta + (W X) \theta + \varepsilon
\]
where:
- $y$ is an $n \times 1$ vector of dependent variable observations (e.g., province-level disease ratios).
- $W$ is an $n \times n$ row-standardized spatial weights matrix.
- $\rho$ is a scalar autoregressive coefficient capturing “outcome contagion” via $W y$.
- $X$ is an $n \times k$ matrix of $k$ explanatory variables (e.g., poverty indicators).
- $\beta$ is a $k \times 1$ vector of direct effects.
- $W X$ is an $n \times k$ matrix of spatially lagged covariates (neighbor characteristics).
- $\theta$ is a $k \times 1$ vector of spillover effects.
- $\varepsilon$ is an $n \times 1$ vector of disturbances, $\varepsilon \sim iid\, N(0, \sigma^2 I)$.

This model collapses to standard spatial autoregressive or spatial error models under restricted parameterizations but is unique in jointly representing endogenous and exogenous spatial interactions. Under regularity conditions ($|\rho| < 1$), the reduced form is given by:
\[
y = (I - \rho W)^{-1}[X\beta + WX\theta] + (I - \rho W)^{-1} \varepsilon
\]
This form is essential for effect decomposition and inference [2601.02848].

## 2. Construction of the Spatial Weights Matrix

In the referenced application, the weights matrix $W$ encodes a fixed-degree undirected network among $n=76$ Thai provinces (excluding Bangkok). Its construction involves:
- Geographical centroid computation for each province.
- For each province $i$, identification of its $K=7$ nearest neighbors ($N_i$) by Euclidean centroid-to-centroid distance.
- Raw adjacency matrix $W^*$ where $w^*_{ij} = 1$ if $j \in N_i$, else $0$.
- Row standardization: $w_{ij} = w^*_{ij} / \sum_{j \in N_i} w^*_{ij} = 1/7$ if $j \in N_i$, $0$ otherwise.

This $K$-nearest neighbor ($K$NN) schema ensures homogeneity in neighbor set cardinality, avoiding the unevenness inherent in contiguity-based schemes [2601.02848].

| Step                       | Description                     | Resultant Matrix/Operation         |
|----------------------------|---------------------------------|------------------------------------|
| Centroid Calculation       | Each province                   | Geographical coordinates           |
| $K$-NN Selection           | 7 nearest centroids per province| Adjacency indicator matrix ($W^*$) |
| Row-Standardization        | Scale rows to sum to 1          | Final $W$: all neighbors $\frac{1}{7}$  |

## 3. Estimation, Identification, and Assumptions

Estimation employs maximum likelihood (MLE) for the SDM with Gaussian errors, implemented (in R) via the `lagsarlm` function from the `spatialreg` package, `type="mixed"` indicating the SDM. Key assumptions include:
- $\varepsilon$ is independently, identically distributed, normal with constant variance.
- $X$ and $WX$ are exogenous and uncorrelated with $\varepsilon$ (no simultaneity).
- $W$ is exogenously specified and such that $(I - \rho W)$ is nonsingular ($|\rho| < 1 / |\lambda_{\max}(W)|$).
- Identification requires sufficient non-collinearity between $X$ and $WX$ for distinct estimation of $\beta$ and $\theta$. Strong collinearity impairs identification, but with distinct spatial and local poverty indicators this is mitigated [2601.02848].

## 4. Decomposition of Effects

In SDMs, feedback through $(I - \rho W)^{-1}$ generates local and propagated effects. For each covariate $j$:
\[
\frac{\partial y}{\partial x'_j} = (I - \rho W)^{-1}[I \beta_j + W \theta_j]
\]
- **Direct effect**: Average of the diagonal elements—average own-unit response to a covariate increase.
- **Indirect (spillover) effect**: Average of off-diagonal row sums—average effect on other units from a covariate change in one unit.
- **Total effect**: Sum of direct and indirect effects.

For example, in modeling digestive disease morbidity ("C2"), direct effects identified living deprivation ($\beta_{living} > 0$). Indirect effects included health deprivation ($\theta_{health} < 0$), accessibility deprivation ($\theta_{accessibility} < 0$), and poor-household count ($\theta_{CNT} > 0$). A one-unit increase in living deprivation increased local morbidity, while increased neighbor health deprivation reduced it, and increased neighboring poor households raised local morbidity [2601.02848].

## 5. Diagnostics and Spatial Dependence Tests

Spatial diagnostics prior to, during, and post-modeling are critical. The following were employed:
- **Global Moran’s I**: Detects overall spatial autocorrelation in $y$:
  \[
  I = \frac{n}{S_0} \frac{ \sum_i \sum_j w_{ij}(y_i - \bar{y})(y_j - \bar{y}) }{ \sum_i (y_i - \bar{y})^2 }
  \]
- **Monte Carlo permutation testing**: Assesses significance of spatial indices.
- **Local Moran’s I (LISA)**: Identifies spatial clusters (HH, LL, HL, LH) with corresponding p-values.
- **LM tests on SDM residuals**: Confirms adequacy by checking for absence of remaining spatial autocorrelation.
- **Model selection criteria**: Akaike Information Criterion (AIC), log-likelihood, and significance of $\rho$ test for improved fit and presence of spatial dependence [2601.02848].

## 6. Practical Implementation (R and Python)

The SDM and diagnostics are operationalized as follows:

**R (spatialreg/spdep):**
```r
library(spdep)
coords <- cbind(province_data$long, province_data$lat)
knn7 <- knearneigh(coords, k=7)
nb7  <- knn2nb(knn7)
listw7 <- nb2listw(nb7, style="W")
y  <- province_data$ICD10_ratio_C2
X  <- as.matrix(province_data[, c("pov.rate","CNT","living","health","education","income","accessibility")])
sdm_C2 <- lagsarlm(y ~ pov.rate + CNT + living + health + education + income + accessibility,
                   data=province_data, listw=listw7, type="mixed")
imp <- impacts(sdm_C2, listw=listw7, R=1000)
lm.morantest(sdm_C2, listw7)
```

**Python (PySAL spreg/libpysal):**
```python
import libpysal
from libpysal.weights import KNN
from spreg import ML_Durbin
w = KNN.from_dataframe(df, k=7)
w.transform = 'R'
y = df['ICD10_ratio_C2'].values.reshape((-1,1))
X = df[['pov.rate','CNT','living','health','education','income','accessibility']].values
sdm = ML_Durbin(y=y, x=X, w=w, name_y='C2', name_x=list_of_X_names, name_w='KNN7')
```
Direct, indirect, and total effects are retrieved using the appropriate `impacts()` or attribute accessors [2601.02848].

## 7. Applications and Implications

Application of the SDM to Thailand’s provincial morbidity and poverty data revealed strong spatial clustering in health outcomes, with neighboring influences often dominating local effects. These results substantiate processes such as contagion, contextual influence, and structural diffusion. The framework underscores the necessity of inter-jurisdictional policy responses, as spillovers cross administrative boundaries. More broadly, the SDM provides a statistical basis for assessing spatial network effects within the study of health inequality, regional vulnerability, and multi-attribute social phenomena [2601.02848].

Source: https://www.emergentmind.com/topics/spatial-durbin-models-sdm