Uncertainty-aware weighted tessellation
Source:R/weighted_voronoi_uncertainty.R
weighted_voronoi_uncertainty.RdRepeats weighted tessellation under stochastic perturbation of generator weights and summarises the results as per-cell membership probabilities, modal allocation, and entropy.
Arguments
- points_sf
An
sfPOINT object containing generator locations and attributes.- weight_col
Character. Name of the weight column in
points_sf.- boundary_sf
An
sfPOLYGON/MULTIPOLYGON defining the domain.- n_sim
Integer. Number of simulation runs.
- weight_sd
Optional numeric. Standard deviation of lognormal weight perturbation on the log scale. If
NULL, no perturbation is applied and the same tessellation is repeated.- distance
Character. One of
"euclidean"or"geodesic".- geodesic_engine
Character. Geodesic engine to use when
distance = "geodesic". Defaults to"multisource".- res
Numeric. Raster resolution in CRS units (e.g. metres).
- keep_simulations
Logical. If
TRUE, return the simulated allocation rasters as a stack.- seed
Optional integer random seed for reproducibility.
- warn_zero_entropy
Logical. If
TRUE, warn when all entropy values are zero across the domain.- prepared
Optional prepared geodesic context created by
prepare_geodesic_context()for repeated compatible geodesic runs.- verbose
Logical. If
TRUE, prints progress.- ...
Additional arguments passed to
weighted_voronoi_domain().
Value
A list with probability surfaces, modal allocation, entropy, and optionally the full simulation stack.
Details
This first implementation supports uncertainty in generator weights only. Weights are perturbed independently across simulations using a lognormal multiplicative model:
w_sim = w * exp(N(0, weight_sd))
The output includes:
- probabilities
A
terra::SpatRasterwith one layer per generator, containing the fraction of simulations in which each cell was assigned to that generator.- modal_allocation
A
terra::SpatRastergiving the most probable generator for each cell.- entropy
A
terra::SpatRastershowing per-cell uncertainty. Higher values indicate less stable allocation across simulations.