[R-sig-Geo] Problems with Kcross.inhom

Rolf Turner r.turner at auckland.ac.nz
Tue Oct 22 00:48:05 CEST 2013



Again, your problem is not reproducible.  We do not have the objects
"north", "west", "W" and "tipo" which are necessary to duplicate your
steps.

I tried to reproduce your problem with an artificial example:

W <- owin(c(0,3350),c(0,6150))
set.seed(42)
Z <- runifpoint(201,win=W)
m <- sample(rep(c("ficus","tienda"),c(131,70)),201)
marks(Z) <- factor(m)
ff <- with(split(Z),bw.diggle(ficus))
tt <- with(split(Z),bw.diggle(tienda))
lambdaf <- with(split(Z),density(ficus,ff,at="points"))
lambdat <- with(split(Z),density(tienda,tt,at="points"))
K <- Kcross.inhom(Z,"ficus","tienda",lambdaf,lambdat)

No problema.

It is possible that the error has something to do with the rather intricate
(1716 vertices) boundary of your observation window.  However since I don't
have that window I can't tell.

cheers,

Rolf Turner


On 10/22/13 10:16, david.villalobos wrote:
> Sure Julia,
>
> First:
>
> I have the following object called "Z"
>
>> Z <- ppp(north, west,window=W,marks=tipo)
>> summary(Z)
> Marked planar point pattern: 201 points
> Average intensity 4.46e-05 points per square unit
>
> Coordinates are integers
> i.e. rounded to the nearest 1 unit
>
> Multitype:
>         frequency proportion intensity
> ficus        131      0.652  2.90e-05
> tienda        70      0.348  1.55e-05
>
> Window: polygonal boundary
> single connected closed polygon with 1716 vertices
> enclosing rectangle: [484546.8, 487897.4] x [1147521.3, 1153682.9] units
> Window area =  4509680 square units
>
> Second:
>
> I calculated the bandwidth sigma for the kernel estimator of point process
> intensity with a Cross Validated Bandwidth Selection for Kernel Density
> (bw.diggle)
>
>> attach(split(Z))
>> f<-bw.diggle(ficus)
>> t<-bw.diggle(tienda)
> Third:
>
> I calculated with the Kernel Smoothed Intensity of Point Pattern
> (density.ppp) the values of the the estimated intensity of the sub-process
> of points of type i and j:
>
>> lambdaf<-density.ppp(ficus,f,at="points")
>> lambdat<-density.ppp(tienda,t,at="points")
> and Finally:
>
> I ran the script for Kcross.inhom for the method (1): estimate intensities
> by nonparametric smoothing, but I had the error.
>
>> K <- Kcross.inhom(Z, "ficus", "tienda", lambdaf, lambdat)
> Error in Kwtsum(dclose, bI, weight, b, 1/lambdaI, breaks) :
>    Weights in K-function were infinite or NA
>
> I tryed the method (2): leave-one-out, but I had the same problems
>
> Any help is appreciated. A lot of thanks.
>
>
>
>
>
>
> --
> View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Problems-with-Kcross-inhom-tp7584914p7584920.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list