| cf_lm_hv | R Documentation |
Trains the CFSM-based Gaussian spatial regression and selects the number of spatial scales through sequential holdout validation.
cf_lm_hv(
y,
x = NULL,
coords,
train_rat = 0.75,
id_train = NULL,
alpha = 0.9,
kernel = "exp",
add_learn = "none",
seed = 123
)
y |
Vector of response variables (N x 1). |
x |
Matrix of covariates (N x K). |
coords |
Matrix of 2-dimensional point coordinates (N x 2). |
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. |
add_learn |
Additional learner trained on the residuals to capture non-linear patterns and/or higher-order interactions. '"rf"' uses a random forest (ranger) and '"lightgbm"' uses LightGBM (lightgbm); both are tuned by minimizing validation SSE. For '"lightgbm"', the predictive quantiles are conformalized on the validation split so that their uncertainty is calibrated. Both learners are optional: the corresponding package (ranger or lightgbm) must be installed, and an informative error is raised if it is not. Default is '"none"', meaning no additional training. |
seed |
Random seed used for the training/validation split when 'id_train' is not supplied. Default is '123'. Set to 'NULL' to allow a different split at each call (useful for assessing split sensitivity). |
A list with the following elements:
Final sum-of-squared error (SSE) for validation samples.
SSEs 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. (2026). Coarse-to-fine spatial modeling: A scalable, machine-learning-compatible framework. *Geographical Analysis*, 58(2), e70034. https://onlinelibrary.wiley.com/doi/10.1111/gean.70034
cf_lm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.