Description Usage Arguments Author(s) Examples
Perform cross-validation for bandwidth selection in a gw-glm model.
1 |
formula |
|
data |
|
bw |
|
coords |
|
gweight |
|
verbose |
|
adapt |
|
longlat |
|
s |
|
family |
|
weights |
|
nn |
|
D |
|
... |
Wesley Brooks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (formula, data, bw, coords, gweight, verbose, adapt,
longlat, s, family, weights, nn, D = NULL, ...)
{
cat(paste("Beginning with bandwidth: ", bw, "\n", sep = ""))
gwglmnet.model = gwglmnet(formula = formula, data = data,
coords = coords, gweight = gweight, bw = bw, verbose = verbose,
longlat = longlat, adapt = adapt, s = s, family = family,
weights = weights, nearest.neighbors = nn, D = D)
cv.error = sum(sapply(gwglmnet.model[["cv.error"]], min))
cat(paste("Bandwidth: ", bw, ". CV error: ", cv.error, "\n",
sep = ""))
return(cv.error)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.