This function prepares the locations of knots for use in 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
PrepKnots(
Coords = NULL,
MinDist = NULL,
JitterDist = 100,
MinLF = NULL,
MaxLF = NULL,
Alphapw = list(Prior = NULL, Min = 20, Max = 1200, Samples = 200)
)
Arguments
- Coords
A numeric matrix or data frame containing the (x, y) coordinates of sampling units.
- MinDist
A numeric value specifying the minimum distance between knots in meters. This distance is used for both
knotDist
andminKnotDist
parameters of the Hmsc::constructKnots function.- JitterDist
A numeric value for the jitter distance applied to overlapping coordinates to avoid exact duplicates. Defaults to 100 meters.
- MinLF, MaxLF
integer. Minimum and maximum number of latent factors to be used. Both default to
NULL
which 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 = 20
,Max = 1200
, andSamples = 200
. IfAlphapw
is NULL or a list with all NULL list items, the default prior will be used. IfPrior
is a matrix, it will be used as the prior. IfPrior
isNULL
, the prior will be generated usingMin
,Max
, andSamples
.Min
andMax
are the minimum and maximum values of the alpha parameter (in kilometer).Samples
is the number of samples to be used in the prior.