
AUC of a geographic-distance null model in cross-validation
Source:R/cv_designs.R
geographic_null.RdClustered records make test presences lie closer to training presences
than test background points do, so any model that predicts "near known
records" scores well (spatial sorting bias). Hijmans (2012) showed that
a model of geographic distance alone, with no environmental predictor,
can reach a high AUC in cross-validation. geographic_null() computes
that null for your folds: for every fold, the prediction at each test
point is minus its distance to the nearest training presence, and the
AUC of that prediction is the value an environmental model has to beat.
Nothing is fitted: the null is a fixed function of distance.
Usage
geographic_null(
points,
fold,
occ,
cv = NULL,
coords = NULL,
points_crs = "EPSG:4326",
crs = NULL
)Arguments
- points
Points (presences and absences or background) with coordinates, in the order of
foldandocc.- fold
Fold of each point.
- occ
1 for presence, 0 for absence or background.
- cv
Optional
evaluate_cv()result of the same folds: the printout then says which models beat the null.- coords, points_crs
Coordinate columns and CRS of
points.- crs
Deprecated: the former name of
points_crs, still accepted with a warning.
Value
An object of class geographic_null: by_fold (fold, AUC),
AUC (mean over folds) and models (with cv: the models' AUC and
whether it is above the null).
Details
Status and limits. The null of Hijmans (2012), computed without
fitting. An environmental model that does not beat it may be predicting
the recording pattern; one that beats it by little gains little from the
environment. Pairwise distance sampling (spatial_sorting_bias())
removes the bias instead of measuring it. What to vary. The folds
(random, blocks, buffered).
References
Hijmans, R.J. (2012) Cross-validation of species distribution models: removing spatial sorting bias and calibration with a null model. Ecology 93, 679-688. doi:10.1890/11-0826.1
Examples
sim <- simulate_enm_data(seed = 1, n_presence = 150, n_absence = 600)
pts <- rbind(cbind(sim$presence, occ = 1), cbind(sim$absence, occ = 0))
fold <- spatial_folds(pts, k = 4, block_size = 100, occ = pts$occ,
seed = 1)
geographic_null(pts, fold, pts$occ)
#> Geographic-distance null: 4 folds
#>
#> IN SHORT
#> - Predicting by distance to the nearest training presence alone reaches a
#> mean AUC of 0.897 on these folds: the folds reward closeness to known
#> records, so a high AUC says little about the environment.
#>
#> fold AUC
#> 1 0.872
#> 2 0.880
#> 3 0.903
#> 4 0.932
#>
#> Null model of Hijmans (2012): prediction = minus the distance to the
#> nearest training presence. The wording above 0.7 is a preENM default, not
#> from the literature.