[R-sig-Geo] spgwr 0.6-2 update

Roger Bivand Roger.Bivand at nhh.no
Sat Jun 27 13:36:52 CEST 2009


Users of spgwr should note a number of changes in the values returned by 
the gwr() function. In spgwr <= 0.5, the local R-squared, local 
coefficient standard errors, and local prediction standard errors were 
reported for GWR seen as many local regressions. In addition, the reported 
effective number of parameters was given in full (2*v1 - v2 on p. 55, eq. 
2.16 in the GWR book).

The first change is that sigma is now reported in three variants, against 
two previously. The former two were either ML (rss/n) or full effective 
degrees of freedom (rss/(n - (2*v1 - v2))), which do not agree with GWR3 
output; a third using the approximation of 2*v1 - v2 by v1 noted on p. 55 
of the GWR book is added (rss/(n - v1)). This value, AICc, and residual 
sum of squares now agree with GWR3.

The other changes relate to seeing GWR not as a collection of local 
models, but rather as a single locally varying coefficients model of the 
data points. If fit.points are not given, and hatmatrix is TRUE, se.fit 
and predictions are set TRUE. Local standard errors are then calculated 
using eq. 2.14-2.15, p.55 in the GWR book (may be suppressed using 
se.fit.CCT=FALSE), and the approximate normalised sigma as given above is 
used to complete. In addition, extra standard errors using the full 
effective number of parameters (2*v1 - v2) are also provided. The 
approximate sigma local standard errors agree with GWR3 and the 
development version of GWR4.

If fit.points are given, then a pre-computed gwr model for just the data 
points with hatmatrix=TRUE should be given in the fittedGWRobject 
argument. The normalised sigmas will be taken from this fitted model.

The same procedure applies to local R-squared, where locally weighted 
residuals from the whole pre-computed gwr model are compared with locally 
weighted deviances between the response variable and its locally weighted 
mean - thanks for clarification to Tomoki Nakaya. These local R-squared 
values agree with those in the development version of GWR4. If fit.points 
are given, then a fittedGWRobject must be given in order for the residuals 
from the whole pre-computed gwr model at the data points to be available.

This changes the reported values of local coefficient standard errors and 
of local R-squared - the change is from seeing the GWR local models as 
many local models to seeing GWR on data points as a single model with 
locally varying coefficients. There is no change in the coefficients 
themselves, in AICc, in the residual sum of squares, or the hat matrix.

In addition, an anova() method for gwr model fits (with hatmatrix=TRUE) 
has been provided, reproducing the ANOVA table in GWR3 output (note that 
you need to choose approx=TRUE to get the GWR3 values).

Hopefully, for the same bandwidth and data, GWR3/4 and gwr() should now 
provide the same output (R-squared only GWR4), and gwr() should also let 
the user examine the closeness in value of v1 and v2 used in computing 
the effective number of parameters.

Roger

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list