multiscale_gwr {mgwrsar}R Documentation

multiscale_gwr This function adapts the multiscale Geographically Weighted Regression (GWR) methodology proposed by Fotheringam et al. in 2017, employing a backward fitting procedure within the MGWRSAR subroutines. The consecutive bandwidth optimizations are performed by minimizing the corrected Akaike criteria.

Description

multiscale_gwr This function adapts the multiscale Geographically Weighted Regression (GWR) methodology proposed by Fotheringam et al. in 2017, employing a backward fitting procedure within the MGWRSAR subroutines. The consecutive bandwidth optimizations are performed by minimizing the corrected Akaike criteria.

Usage

multiscale_gwr(formula,data,coords,Model = 'GWR',kernels='bisq',
control=list(SE=FALSE,adaptive=TRUE,NN=800,isgcv=FALSE),init='GWR',maxiter=100,
nstable=6,crit=0.000001,doMC=FALSE,ncore=1,HF=NULL,H0=NULL,model=NULL)

Arguments

formula

A formula.

data

A dataframe.

coords

default NULL, a dataframe or a matrix with coordinates.

Model

The type of model: Possible values are "GWR" (default), and "MGWRSAR_1_0_kv". See Details for more explanation.

kernels

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

control

a list of extra control arguments, see MGWRSAR help.

init

starting model (lm or GWR)

maxiter

maximum number of iterations in the back-fitting procedure.

nstable

required number of consecutive unchanged optimal bandwidth (by covariate) before leaving optimisation of bandwidth size, default 3.

crit

value to terminate the back-fitting iterations (ratio of change in RMSE)

doMC

A boolean for Parallel computation, default FALSE.

ncore

number of CPU cores for parallel computation, default 1.

HF

if available, a vector containing the optimal bandwidth parameters for each covariate, default NULL.

H0

A bandwidth value for the starting GWR model, default NULL.

model

A previous model estimated using multiscale_gwr function, default NULL.

Value

Return an object of class mgwrsar with at least the following components:

Betav

matrix of coefficients of dim(n,kv) x kv.

Betac

vector of coefficients of length kc.

Model

The sum of square residuals.

Y

The dependent variable.

XC

The explanatory variables with constant coefficients.

XV

The explanatory variables with varying coefficients.

X

The explanatory variables.

W

The spatial weight matrix for spatial dependence.

isgcv

if gcv has been computed.

edf

The estimated degrees of freedom.

formula

The formula.

data

The dataframe used for computation.

Method

The type of model.

coords

The spatial coordinates of observations.

H

A vector of bandwidths.

fixed_vars

The names of constant coefficients.

kernels

The kernel vector.

SSR

The sum of square residuals.

residuals

The vector of residuals.

fit

the vector of fitted values.

sev

local standard error of parameters.

get_ts

Boolean, if trace of hat matrix Tr(S) should be stored.

NN

Maximum number of neighbors for weights computation

See Also

tds_mgwr, bandwidths_mgwrsar, summary_mgwrsar, plot_mgwrsar, predict_mgwrsar

Examples


library(mgwrsar)
mysimu<-simu_multiscale(n=1000)
mydata=mysimu$mydata
coords=mysimu$coords
model_multiscale<-multiscale_gwr(formula=as.formula('Y~X1+X2+X3'),data=mydata,
coords=coords,Model = 'GWR',kernels='bisq',control=list(SE=FALSE,
adaptive=TRUE,NN=900,isgcv=FALSE),init='GWR',nstable=6,crit=0.000001)
summary_mgwrsar(model_multiscale)


[Package mgwrsar version 1.0.5 Index]