| cf_glm_hv | R Documentation |
Trains CF-GLMMs and selects the number of spatial scales through sequential holdout validation.
cf_glm_hv(
y,
x = NULL,
coords,
offset = NULL,
train_rat = 0.75,
id_train = NULL,
alpha = 0.9,
kernel = "exp",
family = gaussian(),
seed = 1234
)
y |
Vector of response variables (N x 1) including continuous, count, and binary responses, following an exponential family distribution. |
x |
Matrix of covariates (N x K). |
coords |
Matrix of 2-dimensional point coordinates (N x 2). |
offset |
Optional. Vector of offset variables (N x 1) included in the
linear predictor, consistent with |
train_rat |
Training sample ratio (default: 0.75). For small to moderate samples (N <= 30000), samples closest to the k-means centers are used for validation samples to stabilize training. For larger samples, training samples are drawn at random. |
id_train |
Optional. ID indicating training samples. If specified, the corresponding samples are used as training samples. Otherwise, training samples are chosen based on 'train_rat'. |
alpha |
Decay ratio of the kernel bandwidth in the coarse-to-fine training (default: 0.9). Values closer to one make the optimization more stringent but increase computation time. |
kernel |
Kernel type for modeling spatial dependence. '"exp"' for the exponential kernel (default) and '"gau"' for the Gaussian kernel. |
family |
Error distribution and link function specification,
consistent with the 'family' argument of |
seed |
Random seed used for the training/validation split when 'id_train' is not supplied. Default is '1234'. Set to 'NULL' to allow a different split at each call (useful for assessing split sensitivity). |
A list with the following elements:
Final deviance loss for validation samples.
Deviance losses obtained at each learning step.
ID of training samples.
Other internally used output objects.
Daisuke Murakami
Murakami, D., Comber, A., Yoshida, T., Tsutsumida, N., Brunsdon, C., & Nakaya, T. (2025). Coarse-to-fine spatial GLMMs for scalable prediction and multiscale analysis. *ArXiv preprint*, 2605.01157. https://doi.org/10.48550/arXiv.2605.01157
cf_glm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.