Selects a subset of simulated fire perimeters by matching their surface distribution to a predefined target histogram. The selection is iterative and probabilistic, aiming to minimize the discrepancy while accumulating a total surface area above a certain threshold (e.g., mean annul burned area).
select_events(
event_sizes,
event_probabilities,
target_hist,
bins,
reference_surface,
surface_threshold,
tolerance,
max_it = 5,
iter_limit = 1e+05,
logaritmic = TRUE
)A list containing the best selection found across all iterations:
Numeric vector of surface values of the events in the best selection.
Integer vector of the original indices (from `event_surfaces`) of the events in the best selection.
Numeric value. The sum of surface areas of the events in the best selection.
Numeric value. The relative discrepancy between the selected events' distribution and the target histogram for the best selection.
Returns `NULL` if no valid selection could be made (e.g., no valid results after iterations).
Numeric vector of surface values for all available simulated events.
Numeric vector of probabilities corresponding to each event in `event_surfaces`. These probabilities are used to influence the selection of events within each bin.
Numeric vector representing the density of the target histogram distribution.
Numeric vector of bin breakpoints used for classifying event surfaces and calculating histograms.
Numeric value representing the total target surface area that the selected events should approximate.
Numeric value between 0 and 1. The selection process continues until the cumulative surface area of selected events is at least `reference_surface * surface_threshold`.
Numeric value. A tolerance level for the final discrepancy. (Note: the current implementation finds the best discrepancy, not necessarily stopping once tolerance is met, but aims for the minimum).
Integer for the maximum number of iterations for the inner loop (default: 100).
Integer for the maximum number of iterations in selection (default: 100000).
Logical. If `TRUE`, a logarithmic transformation is applied to `event_surfaces` before binning and to `selected_surfaces` for histogram calculations (default: `TRUE`).