Description Usage Arguments Value Author(s) Examples
Presence and background samples are highly unbalanced, generally by more than one order of magnitude. Many functions such as gam
or ranger
have an argument named weights
or similar that helps to work around the sample unbalance. Such an argument requires a numeric vector as input, with one position per record in the data used to fit the model. Each value in the weights vector represents the relative weight of a single case, and all the values in the weights vector get to sum 1. For example, if a presence column is 1, 0, 0
, its relative weights would be 0.5, 0.25, 0.25
. The function takes as input an ordered numeric vector of ones and zeroes representing the presence and background data of an input dataset to fit SDMs.
1 | weightPB(x)
|
x |
Ordered numeric vector with ones and zeroes respectively representing presence and background records. This will generally be the "presence" column of a data frame to be used to fit a species distribution model. |
A numeric vector with the weights of the ones and zeroes available in the input vector.
Blas Benito <blasbenito@gmail.com>
1 2 3 | data(virtualSpeciesPB)
weights <- weightPB(x = virtualSpeciesPB$presence)
table(weights)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.