Learn R Programming

mgwrsar (version 1.1)

tds_mgwr: Top-Down Scaling approach of multiscale GWR

Description

This function performs a multiscale Geographically Weighted Regression (GWR) using a top-down scaling approach, adjusting GWR coefficients with a progressively decreasing bandwidth as long as the AICc criterion improves.

Usage

tds_mgwr(formula,data,coords,Model='tds_mgwr',kernels='triangle',
fixed_vars=NULL,H2=NULL,control_tds=list(nns=30,get_AIC=FALSE),
control=list(adaptive=TRUE))

Arguments

formula

a formula.

data

a dataframe.

coords

default NULL, a dataframe or a matrix with coordinates

Model

character containing the type of model: Possible values are "tds_mgwr" and "atds_mgwr", See Details for more explanation.

kernels

A vector containing the kernel types. Possible types: triangle ("triangle"), rectangle ("rectangle"), bisquare ("bisq"), tricube ("tcub"), gaussian ("gauss"), epanechnikov ("epane").

fixed_vars

a vector with the names of spatiallay constant coefficient for mixed model. All other variables present in formula are supposed to be spatially varying. If empty or NULL (default), all variables in formula are supposed to be spatially varying.

H2

A scalar or vector of time bandwidths.

control_tds

list of extra control arguments for tds_mgwr models

control

list of extra control arguments for MGWRSAR wrapper

Details

nns

Length of the sequence of decreasing bandwidth. Should be between 20 and 100, default 30

get_AIC

Boolean, if the Global AICc using Yu et al 2019 should be computed. Required if the second stage 'atds_mgwr' has to be estimated. default FALSE

init_model

Starting model, 'GWR' or 'OLS', 'default OLS'.

model_stage1

If model='tds_mgwr', model_stage1 can be used as a starting model (either a GWR model or a preious tds_mgwr model). For model='atds_mgwr, the user can specified an tds_mgwr model already computed with get_AIC=TRUE. default NULL.

doMC

Parallel computation, default FALSE.

ncore

number of CPU core for parallel computation, default 1

tol

Tolerance for stopping criteria, default 0.0001

nrounds

Number of nrounds for 'atds_mgwr' model. Default 3.

verbose

verbose mode, default FALSE.

V

A vector of decreasing bandwidths given by the user, default NULL

first_nn

The value of the highest bandwidth for the sequence of decreasing bandwidth, default NULL.

minv

The value of the smallest bandwidth for the sequence of decreasing bandwidth, default number of covariates + 2 .

H

A vector of bandwidth, default NULL

Z

A matrix of variables for genralized kernel product, default NULL.

W

A row-standardized spatial weight matrix for Spatial Aurocorrelation, default NULL.

type

Verbose mode, default FALSE.

adaptive

A vector of boolean to choose adaptive version for each kernel.

kernel_w

The type of kernel for computing W, default NULL.

h_w

The bandwidth value for computing W, default 0.

Method

Estimation method for computing the models with Spatial Dependence. '2SLS' or 'B2SLS', default '2SLS'.

TP

Avector of target points, default NULL.

doMC

Parallel computation, default FALSE. If TRUE and control_tds$doMC is also TRUE, then control$doMC is set to FALSE.

ncore

Number of CPU core for parallel computation, default 1

isgcv

If TRUE, compute a LOOCV criteria, default FALSE.

isfgcv

If TRUE, simplify the computation of CV criteria (remove or not i when using local instruments for model with lambda spatially varying), default TRUE.

maxknn

When n >NmaxDist, only the maxknn first neighbours are used for distance compution, default 500.

NmaxDist

When n >NmaxDist only the maxknn first neighbours are used for distance compution, default 5000

verbose

Verbose mode, default FALSE.

See Also

gwr_multiscale, MGWRSAR, bandwidths_mgwrsar, summary_mgwrsar.