Estimates the preprocessing, standardisation, current niche centre,
climatic weighting matrix and empirical radial boundary once. The resulting
object can be reused with project_climniche() for several future periods or
climate models.
Usage
fit_climniche_reference(
current,
occupied = NULL,
occupied_threshold = NULL,
cnfa = NULL,
center = NULL,
sensitivity = NULL,
A = NULL,
metric = c("diag", "factor"),
boundary = 0.95,
scale = TRUE,
preprocess = TRUE,
preprocess_correlation = 0.95,
preprocess_min_sd = 1e-08,
global_mean = NULL,
global_sd = NULL
)Arguments
- current
Numeric matrix or data frame of current climatic conditions. Rows are cells or sites and columns are climatic variables.
- occupied
Reference cells or weights, following the rules used by
fit_climniche().- occupied_threshold
Optional cutoff for numeric reference weights.
- cnfa
Optional compatible CENFA object.
- center
Optional current niche centre in the fitted climatic space.
- sensitivity
Optional non-negative climatic metric weights.
- A
Optional climatic weighting matrix.
- metric
Method used to build
Awhen it is not supplied.- boundary
Weighted quantile defining the empirical radial boundary.
- scale
If
TRUE, standardise retained variables using current-climate means and standard deviations.- preprocess
If
TRUE, remove near-zero variance and highly correlated variables before fitting.- preprocess_correlation
Maximum absolute correlation retained during preprocessing.
- preprocess_min_sd
Minimum current-climate standard deviation as a fraction of the largest finite current standard deviation.
- global_mean, global_sd
Optional centring and scaling values.
Details
The reference object fixes the climatic space used for all subsequent projections. Future conditions do not alter the centre, weighting matrix, standardisation or empirical radial boundary.
Examples
sim <- simulate_climniche(n = 200, p = 6, seed = 4)
reference <- fit_climniche_reference(
sim$current,
occupied = sim$occupied,
sensitivity = sim$sensitivity
)
reference