This function estimates a Multiscale Geographically Weighted Regression (MGWR) model based on the proposition of Fotheringham et al. (2017). Unlike standard GWR where a single bandwidth is used for all covariates, MGWR allows for covariate-specific bandwidths. It uses a backfitting algorithm to iteratively estimate the optimal bandwidth and coefficients for each explanatory variable.
multiscale_gwr(formula, data, coords, kernels = 'bisq',
control_mgwr = list(), control = list())An object of class mgwrsar containing:
Matrix of estimated spatially varying coefficients.
Vector of final optimal bandwidths for each covariate.
Root Mean Square Error of the final model.
Vector of residuals.
Vector of fitted values.
Corrected AIC (if get_AIC = TRUE).
R-squared of the model.
A formula object specifying the model (e.g., y ~ x1 + x2).
A data frame containing the variables in the model.
A matrix or data frame of coordinates (2 columns for spatial, 3 for spatio-temporal).
A character string specifying the kernel type.
Options include 'bisq' (default), 'gauss', 'triangle', 'tricube', 'rectangle'.
A named list of control parameters specific to the MGWR backfitting algorithm. See 'Details' for available components.
A named list of standard control arguments passed to the internal GWR estimation steps. See 'Details' for available components.
Components for control_mgwr:
initCharacter. The type of model used for initialization. Options are 'GWR' (default) or 'lm' (OLS).
maxiterInteger. Maximum number of backfitting iterations. Default is 20.
toleranceNumeric. Convergence threshold based on the change in RMSE or bandwidths. Default is 1e-6.
nstableInteger. Number of consecutive iterations where bandwidths must remain stable to declare convergence. Default is 6.
H0Numeric vector. Optional initial bandwidths for each covariate. If NULL, they are initialized via GWR or global search.
get_AICLogical. If TRUE, calculates the corrected Akaike Information Criterion (AICc) at the end. Default is FALSE.
verboseLogical. If TRUE, prints progress information during backfitting. Default is FALSE.
Components for control:
adaptiveLogical. If TRUE (default), uses an adaptive bandwidth (k-nearest neighbors). If FALSE, uses a fixed distance bandwidth.
TypeCharacter. The type of spatial weighting. 'GD' (Geographical Distance, default) or 'GDT' (Geo-Temporal).
NNInteger. Maximum number of neighbors for matrix truncation (speeds up computation). Default is nrow(data).
ncoreInteger. Number of cores to use for parallel computation.
isgcvLogical. If TRUE, computes Leave-One-Out Cross-Validation scores. Default is FALSE.
Fotheringham, A. S., Yang, W., & Kang, W. (2017). Multiscale geographically weighted regression (MGWR). Annals of the American Association of Geographers, 107(6), 1247-1265.
MGWRSAR, TDS_MGWR, golden_search_bandwidth