Skip to contents

The linking distance L of delimit_m() is derived from the records, so it depends on how they were recorded and prepared. linking_stability() recomputes L

Usage

linking_stability(
  points,
  thin_km = c(5, 10, 20),
  link_search = list(c(50, 300), c(100, 600), c(200, 1200)),
  base = NULL,
  drop = 0.2,
  n_rep = 20,
  link2_max_km = 1000,
  group = NULL,
  extent = NULL,
  exclude = NULL,
  crs = "auto",
  coords = NULL,
  points_crs = "EPSG:4326",
  effort = NULL,
  effort_alpha = 0.05,
  seed = 1
)

Arguments

points

Occurrence records: a data.frame with coordinates (lon/lat or detected column names), a CSV path, an sf object or a terra::SpatVector. Combine modern and fossil records beforehand if both should shape M (e.g. with merge_occurrences()).

thin_km

Thinning grains (km) compared.

List of search ranges (km) compared.

base

Reference setting: list(thin_km = , link_search = ); by default the middle grain and the middle search range.

drop

Share of the thinned records removed in each subsample.

n_rep

Number of subsamples of each kind.

Upper limit (km) for the second linking distance L2.

group

Optional column (e.g. modern / fossil) thinned separately and reported separately.

extent

Optional c(xmin, xmax, ymin, ymax) in longitude/latitude: records outside are dropped and M is clipped to it.

exclude

Polygons to remove from M (e.g. another mountain system). Records inside them are dropped before M is built.

crs

Equal-area projection used for all geometry. "auto": Lambert azimuthal equal-area centred on the data (polar for circumpolar data).

coords, points_crs

Coordinate columns and their CRS when points is a table.

effort

Optional recording effort: a terra::SpatRaster (or a path) whose first layer gives the effort per cell in any unit, e.g. the records of a target group per cell from gbif_effort_rasters(). With it, each spanning-tree link of at least effort_min_km is tested for crossing a gap that was recorded without finding the species, and a derived L is lowered so that it does not reach across such a gap (see Details).

effort_alpha

The gap is taken as surveyed when the probability of recording no record there, if the species occurred there, is below this value (default 0.05, i.e. about three records expected).

seed

Seed for the subsamples.

Value

An object of class linking_stability: settings (one row per grain and search range: thin_km, search_from, search_to, n_records, L), subsamples (type, rep, L), base_L and settings_used.

Details

  • at every combination of thinning grain (thin_km) and search range (link_search), and

  • on n_rep subsamples that drop a share drop of the thinned records, either at random or preferentially from densely recorded areas (each record dropped with a probability proportional to the number of records around it). Removing records from well-sampled regions imitates a range recorded less intensively there, the situation in which a link-based L is most likely to change.

and reports how far L moves from the value at the reference setting (base). A stable L supports using the linking-distance M; an L that moves a lot means M rests on the recording pattern as much as on the range, and alternatives in m_scenarios() deserve as much weight.

Status and limits. A preENM method for a preENM quantity. The grades (L within 10% of the reference "stable", within 25% "moderately stable") are preENM defaults, not from the literature. Settings in which fewer than three links fall within the search range give no L and are listed. Subsampling only removes records, so it cannot show how L would change if unrecorded parts of the range were recorded.

References

Barve, N., Barve, V., Jimenez-Valverde, A., et al. (2011) The crucial role of the accessible area in ecological niche modeling and species distribution modeling. Ecological Modelling 222, 1810-1819. doi:10.1016/j.ecolmodel.2011.02.011

Examples

sim <- simulate_enm_data(seed = 1, n_presence = 150)
st <- linking_stability(sim$presence, thin_km = c(2, 5, 10),
                        link_search = list(c(10, 100), c(20, 200),
                                           c(40, 300)),
                        n_rep = 10)
st
#> Stability of the linking distance L: 9 settings, 20 subsamples (20% of 150 thinned records dropped)
#> 
#> IN SHORT
#> - At the reference setting L = 67 km. Across thinning grains and search
#>   ranges it is moderately stable: 57 to 67 km (-16% to +0%).
#> - Dropping 20% of the records at random: L is unstable, 90% of subsamples
#>   between 67 and 86 km.
#> - Dropping 20% of the records mostly from densely recorded areas: L is
#>   stable, 90% of subsamples between 67 and 73 km.
#> - M rests on the recording pattern as much as on the range: give
#>   alternative M (m_scenarios()) as much weight as the linking-distance M.
#> 
#>  thin_km search_from search_to n_records    L
#>        2          10       100       150 56.9
#>        2          20       200       150 67.5
#>        2          40       300       150 67.5
#>        5          10       100       150 56.9
#>        5          20       200       150 67.5
#>        5          40       300       150 67.5
#>       10          10       100       147 56.9
#>       10          20       200       147 67.5
#>       10          40       300       147 67.5
#> 
#> Reference setting: thin_km 5, search 20-200 km. Dense subsamples drop each
#> record with a probability proportional to the number of records within 72
#> km (3 x the median nearest-neighbour distance). Grades: within 10% of the
#> reference stable, within 25% moderately stable; preENM defaults, not from
#> the literature; subsamples are graded by their 5-95% range.
#> 
#> A preENM sensitivity analysis: how much the result depends on the records,
#> grain and search range behind the linking distance L. The others are listed
#> in ?sensitivity_analyses.
plot_linking_stability(st)