Skip to contents

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 and minKnotDist 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, and Samples = 200. If Alphapw is NULL or a list with all NULL list items, the default prior will be used. If Prior is a matrix, it will be used as the prior. If Prior is NULL, the prior will be generated using Min, Max, and Samples. Min and Max are the minimum and maximum values of the alpha parameter (in kilometer). Samples is the number of samples to be used in the prior.

Value

An object suitable for specifying the random level in HMSC GPP models. This object contains the prepared knot locations.

Author

Ahmed El-Gabbas