The function fit geographically weighted elliptical regression model to explore the non-stationarity for a certain bandwidth and weighting function.
gwer(
formula,
data,
regression.points,
bandwidth,
kernel = "bisquare",
p = 2,
theta = 0,
adapt = NULL,
hatmatrix = FALSE,
family = Normal,
longlat = NULL,
dMat,
weights,
dispersion = NULL,
subset,
na.action = "na.fail",
method = "gwer.fit",
control = glm.control(epsilon = 1e-04, maxit = 100, trace = F),
model = FALSE,
x = FALSE,
y = TRUE,
contrasts = NULL,
offset,
spdisp = TRUE,
parplot = FALSE,
...
)
regression model formula as in glm
.
model data frame, or may be a SpatialPointsDataFrame or SpatialPolygonsDataFrame as defined in package sp.
a Spatial*DataFrame object, i.e. SpatialPointsDataFrame or SpatialPolygonsDataFrame as defined in package sp; Note that no diagnostic information will returned if it is assigned.
value of the selected bandwidth used in the weighting function (see bw.gwer
for bandwidth optimization).
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
the power of the Minkowski distance, default is 2, i.e. the Euclidean distance
an angle in radians to rotate the coordinate system, default is 0
defines the type of bandwidth used. either NULL (default) or a proportion between 0 and 1 of observations to include in weighting scheme (k-nearest neighbours).
if TRUE, return the hatmatrix as a component of the result.
a description of the error distribution to be used in the model (see family.elliptical
for details of family functions).
TRUE if point coordinates are longitude-latitude decimal degrees, in which case distances are measured in kilometers. If x is a SpatialPoints object, the value is taken from the object itself.
a pre-specified distance matrix, it can be calculated by the function gw.dist
an optional numeric vector of weights to be used in the fitting process.
an optional fixed value for dispersion parameter.
an optional numeric vector specifying a subset of observations to be used in the fitting process.
a function which indicates what should happen when the data contain NAs (see glm
).
the method to be used in fitting local models. The default method "bw.gwer" uses Fisher's scoring method. The alternative "model.frame" returns the model frame and does no fitting.
a list of parameters for controlling the fitting process. For elliptical
this is passed by glm.control
.
a logical value indicating whether model frame should be included as a component of the return.
a logical value indicating whether the response vector used in the fitting process should be returned as components of the return.
a logical value indicating whether model matrix used in the fitting process should be returned as components of the return.
an optional list. See the contrasts.arg
of model.matrix.default
.
this can be used to specify an a priori known component to be included in the linear predictor during fitting as in glm
.
if TRUE dispersion parameter varies geographically.
if TRUE the parameters boxplots are plotted.
arguments to be used to form the default control argument if it is not supplied directly.
returns an object of class “gwer”, a list with follow components:
a SpatialPointsDataFrame (may be gridded) or SpatialPolygonsDataFrame object (see package sp) with fit.points, weights, GWR coefficient estimates, dispersion and the residuals in its data
slot.
the matrices of coefficients, standard errors and significance values for parameters hypothesis test.
either the supplied argument or the estimated dispersion with standard error.
hat matrix of the geographically weighted elliptical model.
elliptical global regression on the same model formula.
a list of results values for fitted geographically weighted elliptical model.
the bandwidth used in geographical weighting function.
the fitted mean values of the geographically weighted elliptical model.
a logical value indicating if hatmatrix was considered
a matrix with the geographical weighting for all local elliptical models.
the family
object used.
a matrix with the fitted values for all local elliptical models.
the adapt
object used.
the kernel
object used.
the spdisp
object used.
the function call used.
the longlat
object used.
Brunsdon, C., Fotheringham, A. S. and Charlton, M. E. (1996). Geographically weighted regression: a method for exploring spatial nonstationarity. Geographical analysis, 28(4), 281-298. 10.1111/j.1538-4632.1996.tb00936.x
Cysneiros, F. J. A., Paula, G. A., and Galea, M. (2007). Heteroscedastic symmetrical linear models. Statistics & probability letters, 77(11), 1084-1090. 10.1016/j.spl.2007.01.012
Fang, K. T., Kotz, S. and NG, K. W. (1990, ISBN:9781315897943). Symmetric Multivariate and Related Distributions. London: Chapman and Hall.
# NOT RUN {
data(georgia, package = "spgwr")
fit.formula <- PctBach ~ TotPop90 + PctRural + PctFB + PctPov
gwer.bw.t <- bw.gwer(fit.formula, data = gSRDF, family = Student(3), adapt = TRUE)
gwer.fit.t <- gwer(fit.formula, data = gSRDF, family = Student(3), bandwidth = gwer.bw.t,
adapt = TRUE, parplot = FALSE, hatmatrix = TRUE, spdisp = TRUE,
method = "gwer.fit")
print(gwer.fit.t)
# }
Run the code above in your browser using DataLab