Learn R Programming

GWmodel (version 2.4-1)

gwr.scalable: Scalable GWR

Description

This function implements Scalable GWR for large dataset

Usage

gwr.scalable(formula, data, bw.adapt=100, kernel = "gaussian", polynomial = 4, 
             p = 2, theta = 0, longlat = F, dMat)
# S3 method for scgwrm
print(x, ...)

Value

A list of class “scgwrm”:

GW.arguments

a list class object including the model fitting parameters for generating the report file

GW.diagnostic

a list class object including the diagnostic information of the model fitting

lm

an object of class inheriting from “lm”, see lm.

SDF

a SpatialPointsDataFrame (may be gridded), or SpatialPolygonsDataFrame object (see package “sp”), or sf object (see package “sf”) integrated with fit.points,GWR coefficient estimates, y value,predicted values, coefficient standard errors and t-values in its "data" slot.

timings

starting and ending time.

Arguments

formula

Regression model formula of a formula object

data

a Spatial*DataFrame, i.e. SpatialPointsDataFrame or SpatialPolygonsDataFrame as defined in package sp, or a sf object defined in package sf

bw.adapt

adaptive bandwidth (i.e. number of nearest neighbours) used for geographically weighting

kernel

Kernel function to calculate the spatial weights, but note only two continuous functions available:

gaussian: wgt = exp(-.5*(vdist/bw)^2);

exponential: wgt = exp(-vdist/bw);

polynomial

Degree of the polyunomial to approximate the kernel function, and default is 4.

p

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

theta

an angle in radians to rotate the coordinate system, default is 0

longlat

if TRUE, great circle distances will be calculated

dMat

a pre-specified distance matrix, it can be calculated by the function gw.dist

x

an object of class “scgwrm”, returned by the function gwr.scalable

...

arguments passed through (unused)

Author

Binbin Lu binbinlu@whu.edu.cn

References

Murakami, D., N. Tsutsumida, T. Yoshida, T. Nakaya & B. Lu (2019) Scalable GWR: A linear-time algorithm for large-scale geographically weighted regression with polynomial kernels. arXiv:1905.00266.

Examples

Run this code
if (FALSE) {
require(spData)
data(boston)
boston <- boston.c
coordinates(boston) <- ~ LON + LAT
res <- gwr.scalable(formula = MEDV ~ CRIM + ZN + INDUS + CHAS + AGE, data = boston, bw.adapt = 100)
res
}

Run the code above in your browser using DataLab