[R-sig-Geo] Fwd: Hat matrix in ggwr models with adaptative kernel

Roger Bivand Roger.Bivand at nhh.no
Tue Sep 20 18:14:08 CEST 2011


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
>

-- 
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