Who Are My Neighbors?

Bayesian estimation of spatial weight matrices — and what changes when you stop assuming

8,010links estimated, not assumed
ρ = 0.713reproduced to 5 decimals
2.1×spillover vs own-region effect

Carlos Mendez

Nagoya University (GSID)

August 4, 2026

The seating chart you were handed

You have the transcript of the dinner.

You do not have the seating chart.

Spatial econometrics hands you the chart first — and asks you to trust it.

The Tension

Every spillover estimate is conditional on a matrix somebody chose

\[y_t = \rho W y_t + Z_{t-1}\beta + \varepsilon_t\]

  • \(W\) says who is whose neighbour
  • \(\rho\) says how strongly neighbours matter
  • \(W\) is normally assumed, never estimated

If the map is wrong, every number downstream is wrong.

On this data, contiguity needs ten arbitrary decisions

Ten of ninety European NUTS-1 regions have no queen-contiguity neighbour at all:

Cyprus · Malta · Aegean islands · the Canaries · Åland · Corsica · Sicily & Sardinia · Azores · Madeira · Ireland

You patch each one by hand before the model will run.

None of those patches appears in the results table.

The Investigation

The prior is not a technicality — it is the method

\[p_{ij} \;\propto\; \omega_{ij} \;\times\; m(k_i)\]

Where links can be \(\times\) how many there are.

The trap: a “non-informative” flat prior expects 44.5 neighbours per region.

Every region wired to half of Europe.

“Non-informative” means half of Europe

The implied prior distribution over the neighbour count at n = 90 for all three priors, showing the flat and default priors centred at 44.5 neighbours and the shrinkage prior concentrated near 7.

At n = 90 the flat and default priors expect 44.5 neighbours per region; only the shrinkage prior expects a sparse network.

The word “non-informative” describes the weight you type, not the belief you assert.

The whole method is two function calls

kbar <- 7                                  # expected neighbours per region
b_pr <- ((n - 1) - kbar) / kbar            # 11.714  ->  link prob 7/89
AA   <- W_priors(n = n, W_prior = Wprior,
                 nr_neighbors_prior = bbinompdf(0:(n - 1),
                                                nsize = n - 1,
                                                a = 1, b = b_pr))

res_sarw <- sarw(Y = Y, tt = tt, Z = Z,
                 niter = 200, nretain = 100, W_prior = AA)

Every modelling decision lives in the prior object; sarw() only runs it.

First, check it on a network we built ourselves

Four panels: the true adjacency matrix, the estimated posterior link probabilities, a histogram separating true links from true non-links by their estimated probability, and posterior densities for each parameter against its true value.

True adjacency, estimated link probabilities, the separation of true links from non-links, and each parameter’s posterior against its true value.

AUC 0.976 · 95.3% of 1,560 cells classified correctly

On a network whose answer we already knew, the sampler found it.

But the intervals are not calibrated

True Estimate 95% interval Covered?
\(\rho\) 0.600 0.528 [0.509, 0.542] no
\(\sigma^2\) 0.050 0.064 [0.056, 0.073] no
slope −1.000 −1.032 [−1.053, −1.009] no

The sparsity prior thins the network, and pulls \(\rho\) down with it.

Trust the structure. Hedge the intervals.

The published table reproduces exactly

Quantity Paper Ours Verdict
\(\rho\) 0.71322 0.71322 exact
log initial GVA −0.01692 −0.016922 exact
share high education 0.00044 0.000441 exact
av. indirect, initial GVA −0.03972 −0.039723 exact

12 of 12 quantities exact to the five decimals printed.

Reproducing the published numbers is the licence to reinterpret them.

The model reconstructed national borders

A 90 by 90 heatmap of posterior link probabilities, with regions ordered by supranational group and then country, showing bright blocks along the diagonal where regions of the same country connect.

Posterior link probability, ordered by group then country.

Regions place 35.6% of their neighbourhood weight on compatriots.

Chance would give 7.1%.

Nothing in the specification mentions countries — the model saw only growth, initial productivity and two education shares.

Same country beats shared border

Comparator AUC Share of top links
Same country 0.753 30.2%
Queen contiguity 0.698 17.2%
7-nearest neighbours 0.631 23.9%

The strongest links average 921 km; a random pair averages 1,331 km.

Among the 33 links with probability \(\geq 0.5\): 60.6% share a border (14.2× enrichment) against 75.8% same-country (10.6×).

Nationality organises the whole ranking; geography owns the links the data are certain about.

Long arcs, not short ones, carry the network

A map of Europe with the strongest ten percent of estimated links drawn as arcs between region centroids, coloured teal where the pair also shares a border and orange where it does not.

The strongest 10% of estimated links as arcs between region centroids: teal where the pair also shares a border, orange where it does not.

Teal — the pair also shares a border.

Orange — it does not.

Long orange arcs dominate: Bulgaria to Czechia, Iberia to the Baltic, Greece to Ireland.

Were the estimated network essentially contiguity, this would be a mesh of short teal arcs hugging borders.

Three maps, three answers

Estimated Queen 7-NN
\(\rho\) 0.713 0.607 0.719
High education, total 0.00153 0.00066 0.00074
Indirect ÷ direct 2.11 1.20 2.20

Every sign survives. Every magnitude moves.

The data-chosen map more than doubles the total education effect.

The Resolution

Why that matters for policy

2.11 under the estimated map. 1.20 under contiguity.

Most of the education return leaks across borders — or only about half does. Same data, different map.

What this cannot tell you

Bulgaria → Czechia at probability 1.0 says one thing only: residual co-movement fits better with that link than without it.

It does not mean trade, commuting, or FDI.

With \(T = 19\), genuine transmission and shared exposure to common shocks are indistinguishable.

26.5 effective draws bound what we can claim

  • ESS(\(\rho\)) = 26.5 of 100 retained draws (Geweke \(z = -3.74\)), so a link probability is quantized to 0.01
  • Posterior means are stable across chains and budgets; SDs, intervals and link rankings are not
  • Practical ceiling: about 300 regions
  • \(k = 7\) is a researcher choice — report a sweep, not a number

Report the point estimates. Hedge everything that has a width.

The map is a parameter

Every spatial result you have read is conditional on a map somebody chose — and it does not have to be.

Full tutorial, code and replication bundle: https://carlos-mendez.org/post/r_estimatew/