[R-sig-Geo] Fwd: Hat matrix in ggwr models with adaptative kernel
Roger Bivand
Roger.Bivand at nhh.no
Tue Sep 20 21:56:39 CEST 2011
On Tue, 20 Sep 2011, Marcos Freitas wrote:
> Hi Prof. Bivand,
>
> Thanks for the explanation of the problems founded in the implementation of
> GWR in R. My objective is to use logistic GWR in the generation of land use
> classes probabilities maps in my PhD thesis, an exploratory use as well. The
> objective of having a hat matrix for me is to compute AIC`s to perform a
> comparison of models with different included independent variables. So, I`ll
> be delighted if you or other colleagues would provide me some references
> about those statistical issues on GWR and where I can found more information
> about the spgwr implementation of ggwr function. Certainly, I`ll be asked
> about those issues if I don`t clearly understand and explain such
> implementation. Thanks in advance.
Hi Marcos,
The GWR literature consists of papers "boosting" (promoting) the method,
and quite a lot of unanswered criticism, notably starting with Wheeler &
Tiefelsdorf (2005). That problem is that any collinearity in the data set
may very well be amplified in local settings, that the geographical
weights strengthen any collinearity present. There are other issues too,
such as it being difficult to reconstruct what GWR3 does with respect to
the GWR book - local R2 is an example, where gwr() tries to follow what
may be a forthcoming GWR4.
I don't think it has been shown that GWR is a reliable modelling tool, it
works as an exploratory tool to point up possible misspecification.
Hope this helps,
Roger
>
> Best regards,
>
> Marcos Freitas
>
> 2011/9/20 Roger Bivand <Roger.Bivand at nhh.no>
>
>> On Tue, 20 Sep 2011, Marcos Freitas wrote:
>>
>>
>>>
>>>> Hi to all,
>>>>
>>>> I have some questions about the ggwr logistic GWR function of spgwr
>>>> package. I'm trying to get the hat matrix to calculate the AIC for a
>>>> comparison of different models, but I get a message that the option "hat
>>>> matrix=TRUE" is disabled in ggwr. How can I get the effective number of
>>>> parameters as GWR book (pg.55) for a logistic model based on an adaptative
>>>> gaussian kernel to make this calculation? Is not possible to use AIC instead
>>>> of CV as the criteria for adaptative selection (ggwr.sel function)?
>>>>
>>>> Beyond this questions I have a few others on ggwr function.
>>>>
>>>>
>>>> Is this model considered experimental? How can I get more information
>>>> about the implemented algorithm? It will change soon?
>>>>
>>>>
>> The spgwr package began as an attempt to document what GWR3 does. We found
>> numerous discrepancies, including multiple definitions of AIC, and the
>> unnecessary use of an approximation in the df calculations for the linear
>> model case. The glm case is highly experimental, and given strong doubts
>> about GWR as an approach, is there only for exploring data, not as a
>> statistical model. No hat matrix will be attempted by me, and if anyone
>> contributes one, I'll include it requiring the user to set an argument
>> agreeing to the sentence: "I am aware that GWR has not been shown to be an
>> adequate method beyond exploratory data analysis".
>>
>>
>> I`m using pgirmess package spatial correlograms of Moran`s I to check for
>>>> autocorrelation of residuals of global logistic and logistic gwr models
>>>> (response residuals). It`s correct or does it have another approach to check
>>>> spatial autocorrelation issues on global and local logistic regression
>>>> models?
>>>>
>>>>
>> This is a different question.
>>
>> Roger
>>
>>
>>>> My code is below and the measure to compare between models that I`m using
>>>> is C (area under curve) in Hmisc package. Thanks in advance for all comments
>>>> and suggestions.
>>>>
>>>>
>>>> Marcos Freitas
>>>>
>>>
>>> PhD Student INPE-Brasil
>>>
>>>>
>>>>
>>>>
>>>>
>>>> library(spdep)
>>>> library(spgwr)
>>>>
>>>> library(Hmisc)
>>>>
>>>> fit = readShapePoints("C://Documents and Settings/Marcos Freitas/Meus
>>>> documentos/Doutorado/Area_**Lages_trabalho/TESE_ESDA_**
>>>> LAGES/LOGISTICA/samples_**floresta_01.shp", proj4string=CRS("+proj=utm
>>>> +zone=-22 +datum=WGS84"), verbose = FALSE, repair=FALSE)
>>>>
>>>> head(fit)
>>>>
>>>> bw = ggwr.sel(DEP_VAR ~ declividad + rug_norm + dist_riv + PTH_AR_MN +
>>>> PTH_AR_SD + NP + LPI + MESH + GEOM_DC1, data=fit,
>>>> coords=cbind(dados$Eastings, dados$Northings), adapt=TRUE,
>>>> gweight=gwr.Gauss, family=binomial(link="logit"), verbose=TRUE,
>>>> longlat=NULL, RMSE=FALSE, tol=.Machine$double.eps^0.25)
>>>>
>>>> gwr.deg = ggwr(DEP_VAR ~ declividad + rug_norm + dist_riv + PTH_AR_MN +
>>>> PTH_AR_SD + NP + LPI + MESH + GEOM_DC1, data=fit, coords=cbind(fit$POINT_X,
>>>> fit$POINT_Y), gweight=gwr.Gauss, adapt=bw, family=binomial(link="logit"),
>>>> longlat=NULL, type=c("response"))
>>>>
>>>> write.table (gwr.deg$SDF, file=paste("C://Documents and Settings/Marcos
>>>> Freitas/Meusdocumentos/**Doutorado/Area_Lages_trabalho/**
>>>> TESE_ESDA_LAGES/LOGISTICA/**lgwr_floresta_fit_reduzido", ".txt",
>>>> sep=""))
>>>>
>>>> pred_prob = fit$DEP_VAR - gwr.deg$SDF$response_resids
>>>>
>>>> auc = somers2(pred_prob, fit$DEP_VAR, weights=NULL, normwt=FALSE,
>>>> na.rm=TRUE)
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>> [[alternative HTML version deleted]]
>>>
>>> ______________________________**_________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo at r-project.org
>>> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>>>
>>>
>> --
>> Roger Bivand
>> Department of Economics, NHH Norwegian School of Economics,
>> 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
>>
>>
>
--
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
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