Panel Kernel Density Estimation

Statistics
Introduced by
Parzen (1962); Silverman (1986); extended to panel contexts in spatial econometrics literature
Year
1962 (KDE); panel extension: 1990s–2000s
Type
Nonparametric density estimation
Family
GIS / spatial

What does it do?

Panel Kernel Density Estimation (Panel KDE) applies the kernel density estimator to panel data, in which the same spatial units or locations are observed over several time periods or groups.

It produces a separate smooth density surface for each period or group, so changes in the concentration of a variable can be examined and compared. The method is descriptive: it does not estimate regression coefficients or causal effects.

The intuition behind the method

A kernel density estimate places a smooth bump over each observation and sums the bumps to obtain a continuous density. In a panel, the same locations are measured at several points in time, so the procedure yields a sequence of surfaces rather than a single snapshot. Comparing successive surfaces shows where concentration strengthens, weakens or moves. The main practical decision is the bandwidth, which must be chosen so that the surfaces are comparable across periods without smoothing away real change.

History

Parzen (1962) gives a formal treatment of estimating a probability density function and its mode from a sequence of independent, identically distributed random variables. The estimates considered there are consistent and asymptotically normal. Silverman (1986) is the standard textbook treatment and is cited here for the bandwidth rule.

When to use it

Choose Panel KDE when a continuous or spatially located variable is measured repeatedly on the same units or locations, and the question is how its distribution or spatial concentration changes across periods or groups. Examples include incident locations in city districts across years, or pollutant levels at fixed monitoring stations across seasons. The method suits exploratory and descriptive work where no parametric distribution is assumed. Do not use it when the goal is a causal effect or a regression coefficient, when a period contains too few observations for a stable density estimate, or when there are so few periods that comparing surfaces adds little. Count data is better handled by methods built for counts, since the estimator here is a continuous density.

Limitations and considerations

  • The bandwidth controls the result. Silverman's rule can over-smooth multimodal data, and no single selector is optimal for every panel, so the choice should be checked against each period.
  • Formal comparison of periods relies on resampling procedures, which add computational cost and must respect the dependence across periods for the same units.
  • The estimator assumes independent, identically distributed observations (Parzen, 1962). Repeated measures on the same units depart from this assumption, which affects the reliability of uncertainty statements about changes between periods.
  • Estimates near the boundary of the study area are biased unless a boundary correction is applied.
  • The method is descriptive. It gives no regression coefficients and no causal estimates.
  • Estimating a surface for each of many periods over large spatial datasets is computationally demanding.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • No distributional form is imposed within each period or group, so the surfaces can show multimodal or irregular concentrations that a mean or variance would miss.
  • Each period yields a continuous surface that can be overlaid on a map, so changes in concentration can be read spatially.
  • The pooling choice lets the analyst trade period-specific detail against comparability, using either separate or common bandwidths.
  • Kernel density estimation is available in many common statistical and GIS software environments, so the estimator can be implemented without custom code.

Applications

  • Crime analysis: mapping how the density of incidents shifts across city districts from year to year.
  • Epidemiology: tracking the spatial spread of disease incidence across reporting periods.
  • Urban economics: comparing house-price density surfaces across sub-markets and economic cycles.
  • Environmental monitoring: depicting how pollutant concentration distributions evolve across seasons at fixed monitoring stations.
  • Transportation: analysing the changing density of accidents or congestion events along road networks over time.
  • Ecology: estimating the movement and range shifts of species occurrence across survey years.

How it works

How it works

1

Arrange the data as N spatial units or observations, each recorded at T time points, either balanced or unbalanced. Decide whether to estimate a separate density surface for each period, for each group, or for each period-group combination, because this choice determines what the resulting surfaces describe. Because the same units are observed repeatedly, observations are generally not independent across periods, whereas the estimator's standard theory assumes independent, identically distributed observations (Parzen, 1962). This affects how uncertainty in comparisons should be assessed, as described under temporal comparison.

2

Choose the bandwidth h, which sets how far each kernel spreads and therefore how smooth each surface is. Silverman's rule of thumb, h* = 1.06 σ̂ n^(-1/5), gives a quick reference value, but it assumes an approximately normal shape and can over-smooth multimodal data. Cross-validation or plug-in selectors are more suitable when the distribution has several modes or when sample sizes differ between periods.

Formula
h^* = 1.06\,\hat{\sigma}\,n^{-1/5}
3

For each slice (a period or a group), sum kernels K centred on the observed values and divide by n times h, as in the displayed estimator. Gaussian and Epanechnikov kernels are common choices. The displayed formula is the one-dimensional form. For location coordinates the estimate is a surface over the study area, which requires a two-dimensional kernel with a bandwidth applied in both coordinates. The same principle of summing kernels centred on each observation applies, but the kernel and the normalisation for the two-dimensional case should be checked in the software used.

Formula
\hat{f}(x) = \frac{1}{nh}\sum_{i=1}^{n}K\!\left(\frac{x - x_i}{h}\right)
4

Choose how the slices share information. Separate estimates per period let the bandwidth differ across periods, which suits comparison of shape but not of absolute density. A common bandwidth across periods keeps the surfaces on the same smoothing scale and is the usual choice when the aim is comparison. Mixed-effects or weighted pooling, which borrows strength across sparse panels, is a further option; it requires its own estimation procedure, which should be taken from the relevant software documentation.

5

Compare successive surfaces with difference maps (f_t minus f_(t-1)), density ratio maps, or a test statistic such as the integrated squared difference between two surfaces. Formal significance is usually assessed with a bootstrap or permutation procedure, because the surfaces are estimates rather than observed quantities. Such a procedure must respect the dependence between periods for the same units, since a scheme that ignores it can misstate the uncertainty of the comparison. Present the sequence of surfaces as a series of maps or contours so that the trajectory is visible.

Common pitfalls

  • Adopting one common bandwidth without checking it against the sparsest period. A bandwidth that suits the densest period may leave sparse periods noisy, and one that suits the sparse periods may hide detail in dense ones.
  • Ignoring edge effects near the boundary of the study region, which can create apparent density gradients at the edge.
  • Comparing surfaces estimated with different bandwidths or kernels as if they were on the same scale.
  • Reading a visually prominent peak as a significant change without a formal test of the difference between surfaces.
  • Confusing density (events per unit area) with counts. A small area with high density may contain fewer events than a large area with lower density.

Frequently asked questions

How is Panel KDE different from standard KDE?

Standard KDE produces a single density surface from one sample. Panel KDE applies KDE repeatedly to data organised by panel index (time period, group, or both), producing a set of surfaces that can be compared. The core estimator is the same; the added work lies in bandwidth choice and temporal comparison.

How do I choose the bandwidth for panel data?

When the aim is comparison, a common bandwidth is usually preferred so that the surfaces share one smoothing scale. It can be selected by cross-validation on the pooled data, and the result should be checked against the sparsest period. Silverman's rule gives a reference value but assumes an approximately normal shape. For multimodal distributions or periods of very different size, cross-validation or plug-in selectors are more appropriate. Per-period adaptive bandwidths are an alternative when the goal is the shape of each surface rather than comparability.

Can I formally test whether the density has changed between periods?

Resampling-based comparison is one option. For example, the integrated squared difference between two density surfaces (f_t and f_{t-1}) can be compared with a reference distribution obtained by resampling. The validity of this approach depends on how the resampling handles dependence across periods for the same units, so the scheme should be chosen with that structure in mind. Confirm the available routines and their assumptions in the documentation of the software used.

What if some panels have very few observations?

Sparse panels produce unreliable density estimates even with well-chosen bandwidths. Options include pooling adjacent periods, using an adaptive bandwidth that widens in low-density regions, or applying a mixed-effects density smoother that borrows strength from other panels.

Is Panel KDE the same as space-time KDE?

They overlap but differ in emphasis. Space-time KDE smooths over geographic space and time together using a single joint kernel, treating time as a continuous axis. Panel KDE treats time as a discrete panel index and produces separate spatial density surfaces per period, which are then compared. Panel KDE is more natural when periods correspond to discrete policy regimes, years, or survey waves.

Related methods

Sources

  1. Parzen, E. (1962). On estimation of a probability density function and mode. Annals of Mathematical Statistics, 33(3), 1065-1076.

    Open DOI reference
  2. Silverman, B. W. (1986). Density Estimation for Statistics and Data Analysis. Chapman and Hall, London.

    ISBN: 978-0412246203