Learn R Programming

mgwrsar (version 1.3.1)

TDS_MGWR: Top-Down Scale (TDS) and Adaptive Top-Down Scale (ATDS) Estimation for MGWR

Description

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).

Usage

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))

Value

An object of class mgwrsar containing:

Betav

Matrix of spatially varying coefficients.

H

Vector of optimal bandwidths found for each covariate.

RMSE

Root Mean Square Error of the final model.

AICc

Corrected Akaike Information Criterion (if requested).

fitted.values

Vector of fitted values.

residuals

Vector of residuals.

Arguments

formula

A formula object specifying the model (e.g., y ~ x1 + x2).

data

A data frame containing the variables in the model.

coords

A matrix or data frame of coordinates (2 columns for spatial).

Model

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.

kernels

A character string or vector specifying the kernel type (e.g., 'triangle', 'bisq', 'gauss'). Default is 'triangle'.

fixed_vars

A character vector indicating the names of variables with spatially stationary (fixed) coefficients. Default is NULL.

Ht

Numeric. Optional bandwidth for the second dimension (time) if using spatio-temporal models (Type 'GDT').

control_tds

A named list of control parameters specific to the TDS algorithm:

nns

Integer. Number of bandwidth steps in the decreasing sequence (default 30).

get_AIC

Logical. If TRUE, computes AICc (slower). Default FALSE (except for 'atds_mgwr').

init_model

Character. Initial model type to start backfitting: 'OLS' (default), 'GWR', 'GTWR', or 'known'.

ncore

Integer. Number of cores for parallelization. Default 1.

tol

Numeric. Convergence tolerance. Default 0.001.

nrounds

Integer. Number of boosting rounds for Stage 2 (only for 'atds_mgwr'). Default 3.

control

A named list of standard control arguments passed to the internal MGWRSAR calls:

adaptive

Logical or Vector. TRUE for adaptive bandwidth (nearest neighbors), FALSE for fixed distance. Can be a vector of length 2 for space/time.

Type

Character. Spatial weighting type: 'GD' (Spatial only) or 'GDT' (Space-Time).

NN

Integer. Maximum number of neighbors for distance matrix computation (truncation). Default is nrow(data).

Details

The TDS algorithm works in two stages:

  1. **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.

  2. **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.

References

Geniaux, G. (2024). Top-Down Scale Approaches for Multiscale GWR with Locally Adaptive Bandwidths. Springer Nature.

See Also

MGWRSAR, golden_search_bandwidth