bw.GWPR: Bandwidth selection for basic GWPR

Description Usage Arguments Value Author(s) References Examples

View source: R/bw_GWPR.R

Description

A function for automatic bandwidth selection to calibrate a GWPR model

Usage

1
2
3
4
5
6
bw.GWPR(formula, data, index, SDF, adaptive = FALSE, p = 2, bigdata = FALSE,
               upperratio = 0.25, effect = "individual",
               model = c("pooling", "within", "random"),
               random.method = "swar", approach = c("CV","AIC"), kernel = "bisquare",
               longlat = FALSE, doParallel = FALSE, cluster.number = 2,
               human.set.range = FALSE, h.upper = NULL, h.lower = NULL)

Arguments

formula

The regression formula: : Y ~ X1 + ... + Xk

data

data.frame for the Panel data

index

A vector of the two indexes: (c("ID", "Time"))

SDF

Spatial*DataFrame on which is based the data, with the "ID" in the index

adaptive

If TRUE, adaptive distance bandwidth is used, otherwise, fixed distance bandwidth.

p

The power of the Minkowski distance, default is 2, i.e. the Euclidean distance

bigdata

TRUE or FALSE, if the dataset exceeds 40,000, we strongly recommend set it TRUE

upperratio

Set the ratio between upper boundary of potential bandwidth range and the forthest distance of SDF, if bigdata = T. (default value: 0.25)

effect

The effects introduced in the model, one of "individual" (default) , "time", "twoways", or "nested"

model

Panel model transformation: (c("within", "random", "pooling"))

random.method

Method of estimation for the variance components in the random effects model, one of "swar" (default), "amemiya", "walhus", or "nerlove"

approach

Score used to optimize the bandwidth, c("CV", "AIC")

kernel

bisquare: wgt = (1-(vdist/bw)^2)^2 if vdist < bw, wgt=0 otherwise (default); gaussian: wgt = exp(-.5*(vdist/bw)^2); exponential: wgt = exp(-vdist/bw); tricube: wgt = (1-(vdist/bw)^3)^3 if vdist < bw, wgt=0 otherwise; boxcar: wgt=1 if dist < bw, wgt=0 otherwise

longlat

If TRUE, great circle distances will be calculated

doParallel

If TRUE, "cluster": multi-process technique with the parallel package would be used.

cluster.number

The number of the clusters that user wants to use

human.set.range

If TRUE, the range of bandwidth selection could be set by the user

h.upper

The upper boundary of the potential bandwidth range.

h.lower

The lower boundary of the potential bandwidth range.

Value

The optimal bandwidth

Author(s)

Chao Li <chaoli0394@gmail.com> Shunsuke Managi

References

Fotheringham, A. Stewart, Chris Brunsdon, and Martin Charlton. Geographically weighted regression: the analysis of spatially varying relationships. John Wiley & Sons, 2003.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data(TransAirPolCalif)
data(California)
formula.GWPR <- pm25 ~ co2_mean + Developed_Open_Space_perc + Developed_Low_Intensity_perc +
   Developed_Medium_Intensity_perc + Developed_High_Intensity_perc +
   Open_Water_perc + Woody_Wetlands_perc + Emergent_Herbaceous_Wetlands_perc +
   Deciduous_Forest_perc + Evergreen_Forest_perc + Mixed_Forest_perc +
   Shrub_perc + Grassland_perc + Pasture_perc + Cultivated_Crops_perc +
   pop_density + summer_tmmx + winter_tmmx + summer_rmax + winter_rmax

bw.CV.Fix <- bw.GWPR(formula = formula.GWPR, data = TransAirPolCalif,
                     index = c("GEOID", "year"),
                     SDF = California, adaptive = FALSE, p = 2, bigdata = FALSE,
                     effect = "individual", model = "within", approach = "CV",
                     kernel = "bisquare", longlat = FALSE)

bw.CV.Fix

bw.AIC.Fix <- bw.GWPR(formula = formula.GWPR, data = TransAirPolCalif,
                      index = c("GEOID", "year"),
                      SDF = California, adaptive = FALSE, p = 2, bigdata = FALSE,
                      effect = "individual", model = "within", approach = "AIC",
                      kernel = "bisquare", longlat = FALSE, doParallel = FALSE)
bw.AIC.Fix

GWPR.light documentation built on Oct. 18, 2021, 5:09 p.m.