Companion Julia code for:
D. Frisch and U. D. Hanebeck,
"Density Estimation from Weighted Samples with the Localized Cumulative Distribution,"
in Proceedings of the 2026 IFAC World Congress, Busan, Korea, 2026.
This repository implements nonparametric density estimation on a regular 2D grid from (possibly weighted) samples. The method uses:
- The Localized Cumulative Distribution (LCD) with a modified Cramér–von Mises distance to measure the discrepancy between samples and grid density (no single kernel bandwidth needed).
- Fisher Information regularization for smoothness.
- A square root density representation that enforces nonnegativity and simplifies the Fisher Information to a quadratic form.
- Analytical gradients for efficient L-BFGS optimization.
| File | Description |
|---|---|
dat2grid_weighted.jl |
Density estimation from importance-weighted samples drawn from a biased proposal density (Section 4). |
cd("path/to/this/folder")
import Pkg; Pkg.activate("."); Pkg.instantiate()
include("dat2grid_weighted.jl")Output figures are saved to figures/.
- Distributions.jl — Gaussian mixture sampling and evaluation
- Optimization.jl + OptimizationOptimJL — L-BFGS optimizer
- CairoMakie.jl — Plotting
MIT
