% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spatial_cce.R
\name{spatial_cce_internals}
\alias{spatial_cce_internals}
\title{Spatial Common Correlated Effects}
\description{
Helpers to replace the global cross-sectional averages of classical
CCE with \strong{spatially-weighted local averages}. Given a row-normalised
spatial weight matrix \eqn{W} (\eqn{N \times N}, zero diagonal, rows
summing to one), the cross-sectional average for unit \eqn{i} at
time \eqn{t} becomes
\deqn{\bar{y}_{it} = \sum_{j=1}^N w_{ij} y_{jt},}
i.e. a weighted average over unit \eqn{i}'s spatial neighbours rather
than a global mean across the whole panel. This allows the common
factor proxy to vary across units in a way that respects the spatial
topology of the data (geographical contiguity, trade links, input-
output connections, etc.).
}
\details{
The weight matrix is supplied directly by the user; \code{dcce} makes no
assumptions about how it was constructed. It must be square with
dimensions equal to the number of units, and rows should ideally sum
to one (the helper will row-normalise silently if they do not).
}
\keyword{internal}
