rgeospatialspatialgeogwr

What does the "weights" atrribute do in the gwr function in R?


I am learning to use R to code a simple Geographically Weighted Regression by using gwr.sel() and gwr() functions.When I was reading through the official documentation for gwr(), link: gwr definition

I found there is an attribute called "weights", and it is defined as below:

 **weights**   case weights used as in weighted least squares, beware of scaling issues, probably unsafe

and it is included in the original function definition signature:

  gwr(formula, data=list(), coords, bandwidth, gweight=gwr.Gauss, 
adapt=NULL, hatmatrix = FALSE, fit.points, longlat=NULL, 
se.fit=FALSE, **weights**, cl=NULL, predictions = FALSE, 
    fittedGWRobject = NULL, se.fit.CCT = TRUE)

I found no direct useage example of this attribute either on this documentation or google result, could experts teach me what is parameter is used for in GWR process? Thanks in advance!


Solution

  • I am not an expert on this, but as far as I know is weighted least squares used for data with heteroscedasticity in the error term. Here you can define weights for the covariance matrix of the residuals, see for instance https://newonlinecourses.science.psu.edu/stat501/node/352/