Prepare the locations of knots for use in Gaussian Predictive Process (GPP) models within the HMSC framework. It ensures that knots are spaced at a minimum specified distance and applies jitter to any identical coordinates to avoid overlap.
Usage
prepare_knots(
coordinates = NULL,
min_distance = NULL,
jitter_distance = 100,
min_lf = NULL,
max_lf = NULL,
alphapw = list(Prior = NULL, Min = 10, Max = 1500, Samples = 101)
)Arguments
- coordinates
Numeric matrix or data frame containing the (x, y) coordinates of sampling units.
- min_distance
Numeric. Minimum distance between knots in meters. This distance is used for both
knotDistandminKnotDistparameters of the Hmsc::constructKnots function.- jitter_distance
Numeric. The jitter distance applied to overlapping coordinates to avoid exact duplicates. Defaults to 100 meters.
- min_lf, max_lf
Integer. Minimum and maximum number of latent factors to be used. Both default to
NULLwhich means that the number of latent factors will be estimated from the data. If either is provided, the respective values will be used as arguments to Hmsc::setPriors.- alphapw
Prior for the alpha parameter. Defaults to a list with
Prior = NULL,Min = 10,Max = 1500, andSamples = 101. IfalphapwisNULLor a list with allNULLlist items, the default prior will be used. IfPrioris a matrix, it will be used as the prior. IfPrior = NULL, the prior will be generated using the minimum and maximum values of the alpha parameter (minandmax, respectively; in kilometre) and the number of samples (Samples). Defaults to a prior with 101 samples ranging from 10 to 1500 km, with the first value in the second column set to 0.5.