ggwr.basic: Generalised GWR models with Poisson and Binomial options

View source: R/GeneralizedGWR.r

ggwr.basicR Documentation

Generalised GWR models with Poisson and Binomial options

Description

This function implements generalised GWR

Usage

ggwr.basic(formula, data, regression.points, bw, family =
                 "poisson", kernel = "bisquare", adaptive = FALSE, cv =
                 T, tol = 1e-05, maxiter = 20, p = 2, theta = 0,
                 longlat = F, dMat, dMat1)

 ## S3 method for class 'ggwrm'
print(x, ...)
 

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

regression.points

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

bw

bandwidth used in the weighting function, possibly calculated by bw.ggwr();fixed (distance) or adaptive bandwidth(number of nearest neighbours)

family

a description of the error distribution and link function to be used in the model, which can be specified by “poisson” or “binomial”

kernel

function chosen as follows:

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

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

bisquare: wgt = (1-(vdist/bw)^2)^2 if vdist < bw, wgt=0 otherwise;

tricube: wgt = (1-(vdist/bw)^3)^3 if vdist < bw, wgt=0 otherwise;

boxcar: wgt=1 if dist < bw, wgt=0 otherwise

adaptive

if TRUE calculate an adaptive kernel where the bandwidth corresponds to the number of nearest neighbours (i.e. adaptive distance); default is FALSE, where a fixed kernel is found (bandwidth is a fixed distance)

cv

if TRUE, cross-validation data will be calculated

tol

the threshold that determines the convergence of the IRLS procedure

maxiter

the maximum number of times to try the IRLS procedure

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 between regression points and observations, it can be calculated by the function gw.dist

dMat1

a square distance matrix between each pair of observations, it can be calculated by the function gw.dist

x

an object of class “ggwrm”, returned by the function gwr.generalised

...

arguments passed through (unused)

Value

A list of class “ggwrm”:

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

glm.res

an object of class inheriting from “glm” which inherits from the class “lm”, see glm.

SDF

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

CV

a data vector consisting of the cross-validation data

Note

Note that this function calibrates a Generalised GWR model via an approximating algorithm, which is different from the back-fitting algorithm used in the GWR4 software by Tomoki Nakaya.

Author(s)

Binbin Lu binbinlu@whu.edu.cn

References

Nakaya, T., A. S. Fotheringham, C. Brunsdon & M. Charlton (2005) Geographically weighted Poisson regression for disease association mapping. Statistics in Medicine, 24, 2695-2717.

Nakaya, T., M. Charlton, S. Fotheringham & C. Brunsdon. 2009. How to use SGWRWIN (GWR4.0). Maynooth, Ireland: National Centre for Geocomputation.

Fotheringham S, Brunsdon, C, and Charlton, M (2002), Geographically Weighted Regression: The Analysis of Spatially Varying Relationships, Chichester: Wiley.

Examples

data(LondonHP)
## Not run: 
DM<-gw.dist(dp.locat=coordinates(londonhp))
bw.f1 <- bw.ggwr(BATH2~FLOORSZ,data=londonhp, dMat=DM)
res.poisson<-ggwr.basic(BATH2~FLOORSZ, bw=bw.f1,data=londonhp, dMat=DM)
bw.f2 <- bw.ggwr(BATH2~FLOORSZ,data=londonhp, dMat=DM,family ="binomial")
res.binomial<-ggwr.basic(BATH2~FLOORSZ, bw=bw.f2,data=londonhp, dMat=DM,
              family ="binomial")

## End(Not run)

GWmodel documentation built on Sept. 11, 2024, 9:09 p.m.