Skip to contents

Applies every threshold of a thresholds() result to a prediction raster and counts, per cell, the rules under which the cell is suitable (prediction >= threshold). Cells suitable under all rules are the robust core of the mapped range; cells suitable under at least one rule its widest extent. The summary gives the area of each.

Usage

threshold_agreement(raster, thresholds, model = NULL)

Arguments

raster

The prediction raster (terra::SpatRaster or file); one layer, or the layer named after the model.

thresholds

A result of thresholds().

model

The model (layer and rows of thresholds) when thresholds covers several models.

Value

A list of class threshold_agreement with count (an integer raster: number of rules calling the cell suitable), rules (the distinct rules and thresholds used) and summary (cells and area, km2, suitable under all rules, under most, i.e. more than half, and under at least one).

Details

Rules with the same threshold (e.g. maxSSS and maxTSS) are counted once, so that the count is not inflated by duplicates.

Status and limits. A preENM summary. The core and the widest extent depend on which rules are included.

References

Liu, C., Berry, P.M., Dawson, T.P., Pearson, R.G. (2005) Selecting thresholds of occurrence in the prediction of species distributions. Ecography 28, 385-393. doi:10.1111/j.0906-7590.2005.03957.x

Hellegers, M., van Hinsberg, A., Lenoir, J., Dengler, J., Huijbregts, M.A.J., Schipper, A.M. (2025) Multiple threshold-selection methods are needed to binarise species distribution model predictions. Diversity and Distributions 31, e70019. doi:10.1111/ddi.70019

Examples

sim <- simulate_enm_data(seed = 1)
tab <- extract_predictions(sim$models, sim$presence, sim$absence)
th <- thresholds(tab)
ag <- threshold_agreement(sim$models[["GLM"]], th, model = "GLM")
ag
#> Agreement of 7 threshold rules (maxSSS, equal_ss, maxMCC, prevalence, fixed_sens, p10, mutation_point)
#> 
#>     suitable_under cells area_km2 share
#>          all rules  2650   254711   56%
#>         most rules  2865   275305   60%
#>  at least one rule  3149   302503   66%
#> 
#> IN SHORT
#> - Suitable under every rule: 254711 km2 (56% of the area); under at least one
#>     rule: 302503 km2 (66%). The widest mapped range is 1.2 times the range on
#>     which all rules agree.
plot_thresholds(ag)