gw.glm.bw {lctools} | R Documentation |
Optimal bandwidth estimation for Generalised Geographically Weighted Regression (GGWR)
Description
This function helps choosing the optimal bandwidth for the Generalised Geographically Weighted Regression (GGWR). At the moment the latter refers to the Geographically Weighted Poisson Regression (GWPR).
Usage
gw.glm.bw(formula, family, dframe, coords, kernel, algorithm="exhaustive",
optim.method="Nelder-Mead", b.min=NULL, b.max=NULL, step=NULL)
Arguments
formula |
the local model to be fitted using the same syntax used in the glm function in R. This is a sting that is passed to the sub-models' |
family |
a description of the error distribution and link function to be used in the local model as in the |
dframe |
a numeric data frame of at least two suitable variables (one dependent and one independent) |
coords |
a numeric matrix or data frame of two columns giving the X,Y coordinates of the observations |
kernel |
the kernel to be used in the regression. Options are "adaptive" or "fixed". The weighting scheme used here is defined by the bi-square function |
algorithm |
a character argument that specifies whether the function will use an |
optim.method |
the optimisation method to be used. A detailed discussion is available at the 'Details' section of the function |
b.min |
the minimum bandwidth. This is important for both algorithms. In the case of the |
b.max |
the maximum bandwidth. This is important for both algorithms. In the case of the |
step |
this numeric argument is used only in the case of a |
Details
Please carefully read the function optim(stats)
when using a heuristic
algorithm.
Value
bw |
The optimal bandwidth (fixed or adaptive) |
CV |
The corresponding Cross Validation score for the optimal bandwidth |
CVs |
Available only in the case of the |
Warning
Large datasets increase the processing time.
Note
Please select the optimisation algorithm carefully. This function needs further testing. Please report any bugs!
Author(s)
Stamatis Kalogirou <stamatis.science@gmail.com>
References
Kalogirou, S. (2016) Destination Choice of Athenians: an application of geographically weighted versions of standard and zero inflated Poisson spatial interaction models, Geographical Analysis, 48(2),pp. 191-230. DOI: 10.1111/gean.12092 https://onlinelibrary.wiley.com/doi/abs/10.1111/gean.12092
See Also
Examples
RDF <- random.test.data(12,12,3,"poisson")
gwpr.bw <-gw.glm.bw(dep ~ X1 + X2, "poisson", RDF, cbind(RDF$X,RDF$Y),
kernel = 'adaptive', b.min = 48, b.max=50)