Determines where a spatial prediction model can be trusted, following Meyer & Pebesma (2021). Combines the dissimilarity index (DI) with a threshold derived from cross-validated DI values to produce a binary applicability mask.
Usage
borg_aoa(
train,
new,
predictors = NULL,
coords = NULL,
weights = NULL,
folds = NULL,
threshold = NULL,
normalize = FALSE
)Arguments
- train
Data frame of training data.
- new
Data frame of prediction locations (same predictor columns).
- predictors
Character vector. Predictor column names.
- coords
Character vector of length 2. Coordinate columns in
newfor spatial mapping. Optional.- weights
Numeric vector. Variable importance weights.
- folds
Optional
borg_cvobject or fold list. If provided, the threshold is derived from cross-validated DI (more robust).- threshold
Numeric. Manual DI threshold override. If
NULL, computed as the outlier-adjusted maximum (Q75 + 1.5 * IQR rule) of the LOO training DI, or of the cross-validated DI whenfoldsis given.- normalize
Logical. If
TRUE, add adi_normcolumn holding the dissimilarity index rescaled by the AOA threshold, so thatdi_norm = 1marks the applicability boundary and values above 1 lie outside the AOA. Makes DI comparable across models and thresholds. Default:FALSE.
Value
A data frame with class "borg_aoa" containing:
- di
Dissimilarity index for each prediction point
- aoa
Logical. TRUE if inside AOA (DI <= threshold)
- di_norm
DI divided by the threshold (only when
normalize = TRUE); the AOA boundary sits at 1- x, y
Coordinates (if
coordsprovided)
Has autoplot() method showing the AOA map.
References
Meyer, H., & Pebesma, E. (2021). Predicting into unknown space? Estimating the area of applicability of spatial prediction models. Methods in Ecology and Evolution, 12(9), 1620-1633. doi:10.1111/2041-210X.13650