[R-sig-Geo] Strange results in DCluster package

Virgilio Gomez Rubio Virgilio.Gomez at uclm.es
Thu Mar 1 20:36:20 CET 2012


Dear Corey,

Many thanks for reporting this. I have checked your code and the data and 
I cannot find a problem in
kn.iscluster. The only issue is that the log-test statistic in some
cases is large (e.g., 12225.064474) and when the test statistic is
computed, then R returns Inf.

I have changed the code so that argument log.v=TRUE can be set in a call
to opgam() and it is passed to kn.iscluster. Hence, the log-test
statistic is returned. The package should appear on CRAN in one day or two but I 
can send you the source code if you are in a hurry.

With the new version, you can write:

knres<-opgam(data=sa, thegrid=sa[,c("x", "y")], alpha=.05, R=999, 
iscluster=kn.iscluster, fractpop=.25, model="poisson", mle=mle, log.v=TRUE) 


and you will get something like this:

           x       y    statistic cluster pvalue size
1   549400.3 3255340 12225.064474       1  0.001    1
2   550731.4 3255426  9525.112869       1  0.001    4
3   550353.6 3253989  6416.805872       1  0.001    8
4   548815.9 3254113 10258.441514       1  0.001    3
(...)

In order to get the most likely cluster, you can compare the 
returned (log)-statistics.

Hope this helps.

Best,

Virgilio



More information about the R-sig-Geo mailing list