Bayesian Kernel Density Estimation
Also known as: Bayesian KDE, BKDE, Bayesian nonparametric density estimation, Bayesian adaptive KDE
Bayesian Kernel Density Estimation (BKDE) is a nonparametric method for estimating the probability density function of a spatial or attribute variable by combining a kernel smoother with a Bayesian prior over the bandwidth parameter. The posterior distribution of the bandwidth propagates uncertainty into the final density estimate rather than treating the bandwidth as a fixed tuning constant.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
Use Bayesian KDE when you need a smooth density surface for spatial point data or univariate continuous data and want principled uncertainty quantification around the density estimate itself. It is particularly valuable with small to moderate samples where classical cross-validation bandwidth selection is noisy, or when domain knowledge about spatial scale can be encoded as a prior. Avoid it when the dataset is very large (n > 50 000) and computational speed is critical, or when a simple heat-map without uncertainty is sufficient; in those cases classical KDE with cross-validated bandwidth is more practical.
Strengths & limitations
- Propagates bandwidth uncertainty into the density estimate, providing credible intervals rather than a single point estimate.
- Prior knowledge about the spatial scale of the phenomenon can be incorporated formally through the bandwidth prior.
- More stable than cross-validation bandwidth selection in small samples.
- Handles spatial and non-spatial continuous data without distributional assumptions.
- Can be extended to adaptive Bayesian KDE where the bandwidth varies locally with data density.
- Computationally more demanding than classical KDE because it requires numerical integration or MCMC over the bandwidth posterior.
- Posterior results are sensitive to the choice of prior on h, especially with small samples.
- Interpretability of the marginalised density surface can be harder to communicate to non-Bayesian audiences.
- Does not model spatial dependence structure explicitly; for spatially correlated data, kriging or spatial regression may be more appropriate.
Frequently asked
How is Bayesian KDE different from ordinary KDE?
Ordinary KDE selects a single bandwidth (typically by cross-validation or Silverman's rule) and uses it throughout. Bayesian KDE treats the bandwidth as a random variable, places a prior on it, and averages the density surface over the posterior distribution of the bandwidth, producing uncertainty estimates rather than a single surface.
What prior should I use for the bandwidth?
A log-normal or half-normal prior on h is common because bandwidth must be positive and the log-scale reflects multiplicative uncertainty in smoothing. Setting the prior mean near a reference bandwidth (e.g., Silverman's rule-of-thumb value) and using a moderate standard deviation is a reasonable starting point, after which prior sensitivity should be assessed.
Can Bayesian KDE be used for spatial data in two dimensions?
Yes. The kernel and bandwidth parameter can be extended to two dimensions (a bandwidth matrix H), and a prior is placed over H. The computational cost increases but the logic is identical. Most implementations simplify by using a scalar bandwidth and isotropic kernel.
When should I use kriging instead of Bayesian KDE for spatial density?
Use kriging when your variable is a continuous measurement recorded at sample locations and you need to interpolate its value at unsampled locations. Use Bayesian KDE when you have a point pattern (event locations) and want to estimate the spatial intensity or density of events.
How is the bandwidth posterior computed in practice?
The leave-one-out cross-validation likelihood is evaluated on a grid of h values, combined with the prior, and normalised to approximate the posterior. For higher-dimensional bandwidth matrices, MCMC (e.g., Metropolis-Hastings) is used to draw samples from the posterior.
Sources
- Hjort, N. L., & Glad, I. K. (1995). Nonparametric density estimation with a parametric start. The Annals of Statistics, 23(3), 882–904. DOI: 10.1214/aos/1176324627 ↗
- Kernel density estimation. Wikipedia. link ↗
How to cite this page
ScholarGate. (2026, June 3). Bayesian Kernel Density Estimation. ScholarGate. https://scholargate.app/en/spatial-analysis/bayesian-kernel-density-estimation
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Bayesian KrigingSpatial analysis↔ compare
- Bayesian Spatial RegressionSpatial analysis↔ compare
- Hot Spot AnalysisSpatial analysis↔ compare
- Local KrigingSpatial analysis↔ compare
- Spatial AutocorrelationSpatial analysis↔ compare