Presence-only records give a response of ones. A model needs units where the response is zero,
and these are drawn from pool, a table of background units that carry the same columns as the
targets (an identifier, the static predictors, the coords, and a record in series for
each). The strategies are bm_PseudoAbsences()'s:
Usage
pseudo_absences(
pool,
presences,
n,
strategy = c("random", "sre", "disk"),
id = NULL,
env = NULL,
quantile = 0.025,
coords = NULL,
dist_min = 0,
dist_max = Inf,
lonlat = FALSE,
repeats = 1L,
seed = 1L
)Arguments
- pool
A data frame of background units.
- presences
A data frame of the presences, with the columns the strategy reads.
- n
Number of pseudo-absences in each draw.
- strategy
"random","sre"or"disk".- id
The column naming a unit in both tables, or
NULLwhere no unit of the pool is a presence.- env
For
"sre", the numeric columns the envelope is drawn on.- quantile
For
"sre", the share of the presences left outside at each end of a column, in[0, 0.5].- coords
For
"disk", the two columns holding the coordinates.- dist_min, dist_max
For
"disk", the least and greatest distance from the nearest presence.- lonlat
For
"disk", whethercoordsare longitude and latitude in degrees.- repeats
Number of independent draws, each with its own seed.
- seed
Random seed of the first draw; draw
rusesseed + r - 1.
Value
The drawn rows of pool, with the columns set (the draw) and pseudo (TRUE),
of class timesift_pseudo_absences.
Details
"random": any unit of the pool that is not a presence."sre": a unit outside the envelope of the presences, the band between thequantileand1 - quantilequantiles of each of theenvcolumns over the presences, asenvelope()draws it. A unit is outside where it leaves the band in at least one column."disk": a unit whose distance to the nearest presence lies betweendist_minanddist_max, both included, oncoords. The distance is planar in the units of the coordinates, or in metres from longitude and latitude in degrees wherelonlatisTRUE, on a sphere of radius 6371008.8 m.
A presence is never its own absence: a unit of the pool whose id is one of the presences' is
not a candidate. The units a strategy admits are the same in both languages; which n of them
are drawn depends on the language's generator, as the folds of fold_map() do. To fix the
units, draw once and keep the table. A set of one's own is the rows of pool it names, and
needs no strategy.
The drawn units are not flagged in a fit: bind them to the presences with a response of zero
and fit as one table. Their pseudo column says which they are, and set which draw.