This function implements the "Top-Down Scale" (TDS) methodology for estimating Multiscale Geographically Weighted Regression (MGWR) models. Unlike classical backfitting approaches that fully optimize bandwidths at each iteration, TDS uses a pre-defined sequence of decreasing bandwidths to efficiently identify the optimal spatial scale for each covariate.
The function supports two main algorithms:
'tds_mgwr': A backfitting algorithm that selects a unique optimal bandwidth for each covariate from a decreasing sequence.
'atds_mgwr': Extends 'tds_mgwr' with a second "boosting" stage (Adaptive TDS). It refines estimates by allowing bandwidths to vary locally, capturing complex spatial patterns (e.g., simultaneous large-scale trends and local variations).
TDS_MGWR(formula, data, coords, Model = 'tds_mgwr',
kernels = 'gauss', fixed_vars = NULL, Ht = NULL,
control_tds = list(nns = 25, get_AIC = FALSE, init_model = "OLS"),
control = list(adaptive = TRUE))An object of class mgwrsar containing:
Matrix of spatially varying coefficients.
Vector of optimal bandwidths found for each covariate.
Root Mean Square Error of the final model.
Corrected Akaike Information Criterion (if requested).
Vector of fitted values.
Vector of residuals.
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).
A character string specifying the algorithm. Options:
'tds_mgwr' (default): Top-Down Scale MGWR (Stage 1 only).
'atds_mgwr': Adaptive Top-Down Scale MGWR (Stage 1 + Stage 2 boosting).
'atds_gwr': Univariate Adaptive Top-Down Scale GWR.
A character string or vector specifying the kernel type (e.g., 'triangle', 'bisq', 'gauss'). Default is 'triangle'.
A character vector indicating the names of variables with spatially stationary (fixed) coefficients. Default is NULL.
Numeric. Optional bandwidth for the second dimension (time) if using spatio-temporal models (Type 'GDT').
A named list of control parameters specific to the TDS algorithm:
nnsInteger. Number of bandwidth steps in the decreasing sequence (default 30).
get_AICLogical. If TRUE, computes AICc (slower). Default FALSE (except for 'atds_mgwr').
init_modelCharacter. Initial model type to start backfitting: 'OLS' (default), 'GWR', 'GTWR', or 'known'.
ncoreInteger. Number of cores for parallelization. Default 1.
tolNumeric. Convergence tolerance. Default 0.001.
nroundsInteger. Number of boosting rounds for Stage 2 (only for 'atds_mgwr'). Default 3.
A named list of standard control arguments passed to the internal MGWRSAR calls:
adaptiveLogical or Vector. TRUE for adaptive bandwidth (nearest neighbors), FALSE for fixed distance. Can be a vector of length 2 for space/time.
TypeCharacter. Spatial weighting type: 'GD' (Spatial only) or 'GDT' (Space-Time).
NNInteger. Maximum number of neighbors for distance matrix computation (truncation). Default is nrow(data).
The TDS algorithm works in two stages:
**Stage 1 (Backfitting):** Starts with a global model (OLS) or a simple GWR. It iteratively updates the bandwidth for each covariate by testing values from a decreasing sequence. This avoids the "yo-yo" effect of standard backfitting and converges faster.
**Stage 2 (Boosting - atds_mgwr only):** Uses the residuals from Stage 1 to iteratively refine coefficients. This stage allows the effective bandwidth to adapt locally, improving accuracy for covariates with spatially heterogeneous scales.
Geniaux, G. (2024). Top-Down Scale Approaches for Multiscale GWR with Locally Adaptive Bandwidths. Springer Nature.
MGWRSAR, golden_search_bandwidth