Skip to contents

A check to run before any model is projected. Between the present and a projection (another period, scenario or region) some conditions of the study area disappear and others appear that are not there today (Williams et al. 2007). This shift of the available environment, not the species, is what makes projections biased: a model can only call suitable what it saw during training, so when present conditions disappear most methods predict a decline for any set of points, and where new conditions appear the prediction is extrapolated and depends on the algorithm (Warren et al. 2021).

Usage

environment_shift(reference, projections, trim = 0.005, n = 50000, seed = 1)

Arguments

reference

Present variables of the study area (terra::SpatRaster or files).

projections

The same variables for the projection: a raster, or a named list of rasters for several projections. Layer names must match those of reference.

trim

Share of cells dropped at each end of a range.

n

Maximum number of cells sampled from each raster.

seed

Seed.

Value

A data.frame of class environment_shift with projection, variable, shift_sd, disappearing and novel.

Details

For every projection and variable the function reports the shift of the mean in units of the present standard deviation (shift_sd), the share of present cells whose value no longer occurs in the projection (disappearing) and the share of projected cells whose value does not occur at present (novel); the row (any variable) counts cells for which this is true for at least one variable. "Occurs" means within the range of the other period after dropping trim of its cells at each end. A large disappearing share says that a decline will be predicted whatever the records are; test it with transfer_bias_test() and map the new conditions with extrapolation_risk().

References

Williams, J.W., Jackson, S.T., Kutzbach, J.E. (2007) Projected distributions of novel and disappearing climates by 2100 AD. PNAS 104, 5738-5742.

Warren, D.L., Dornburg, A., Zapfe, K., Iglesias, T.L. (2021) The effects of climate change on Australia's only endemic Pokemon: measuring bias in species distribution models. Methods in Ecology and Evolution 12, 985-995.

Examples

sim <- simulate_enm_data(seed = 1)
warmer <- sim$env
warmer[[1]] <- warmer[[1]] + 0.3
environment_shift(sim$env, list(warmer = warmer))
#> Change of the available environment
#> 
#>  projection       variable shift_sd disappearing novel
#>      warmer           env1     1.04          0.3   0.3
#>      warmer           env2     0.00          0.0   0.0
#>      warmer (any variable)       NA          0.3   0.3
#> 
#> - warmer: 30% of present cells have conditions that disappear and 30% of
#>     projected cells have new ones. Expect a predicted decline that does not
#>     depend on the records; predictions in the new conditions are extrapolated
#>     and depend on the algorithm. Check with transfer_bias_test().