powered by
The Golden Section Search (GSS) algorithm is used in searching for the best bandwidth for geographically weighted regression. For more details see Da Silva and Mendes (2018).
gss_gwbr( yvar, xvar, lat, long, data, method = c("fixed_g", "fixed_bsq", "adaptive_bsq"), link = c("logit", "probit", "loglog", "cloglog"), type = c("cv", "aic"), globalmin = TRUE, distancekm = TRUE, maxint = 100 )
A list that contains:
global_min - Global minimum of the function, giving the best bandwidth (h).
global_min
h
local_mins - Local minimums of the function.
local_mins
type - Function used to estimate the bandwidth.
type
A vector with the response variable name.
A vector with descriptive variable(s) name(s).
A vector with the latitude variable name.
A vector with the longitude variable name.
A data set object with yvar and xvar.
yvar
xvar
Kernel function used to set bandwidth parameter. The options are: "fixed_g", "fixed_bsq" or "adaptive_bsq". The default is "fixed_g".
"fixed_g"
"fixed_bsq"
"adaptive_bsq"
The link function used in modeling. The options are: "logit", "probit", "loglog" or "cloglog". The default is "logit".
"logit"
"probit"
"loglog"
"cloglog"
Can be "cv", when the Cross-Validation function is used to estimate the bandwidth or "aic", when the AIC function is used. The default is "cv".
"cv"
"aic"
Logical. If TRUE search for the global minimum. The default is TRUE.
TRUE
Logical. If TRUE use the distance in kilometers otherwise, use the Euclidean distance. The default is TRUE.
A maximum number of iterations to numerically maximize the log-likelihood function in search of parameter estimates. The default is maxint=100.
maxint=100
# \donttest{ data(saopaulo) output_list=gss_gwbr("prop_landline",c("prop_urb","prop_poor"),"y","x",saopaulo,"fixed_g") ## Best bandwidth output_list$global_min # }
Run the code above in your browser using DataLab