gwr.bw.est | R Documentation |
Estimate the kernel function bandwidth with cross-validation
gwr.bw.est(form, locs, data, kernel = "exp", cv.tol)
form |
A regression model forumula, as in the functions lm and glm |
locs |
A matrix of spatial coordinates of data points, where the x coordinate is first, then the y coordinate; coordinates are assumed to not be latitude and longitude, as Euclidean distance is calculated from coordinates |
data |
A data frame with data to fit model |
kernel |
A kernel weighting function, either exp or gauss, where exponential function is default |
cv.tol |
A stopping tolerance in terms of cross-validation error for the bi-section search routine to estimate the kernel bandwidth using cross-validation; if missing an internally calculated value is used |
This function estimates the kernel bandwidth in a GWR model with leave-one-out cross-validation. It does not estimate the final regression coefficients or outcome variable.
A list with the following items:
phi |
Kernel bandwidth |
RMSPE |
Root mean squared prediction error from bandwidth estimation |
cv.score |
Sum of squared prediction errors from bandwidth estimation |
David Wheeler
Wheeler DC (2007) Diagnostic tools and a remedial method for collinearity in geographically weighted regression. Environment and Planning A, 39: 2464-2481
gwr.est
data(columbus) locs <- cbind(columbus$x, columbus$y) col.bw <- gwr.bw.est(crime ~ income + houseval, locs, columbus, "exp") col.gwr <- gwr.est(crime ~ income + houseval, locs, columbus, "exp", bw=col.bw$phi)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.