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

Marcelino de la Cruz marcelino.delacruz at upm.es
Tue Oct 22 18:21:07 CEST 2013


It seems that you get an estimate of lambda= 0.00000  for your ficus 
point #2. Kinhom can only be estimated when lambda > 0 in all points.

I would use either another sigma for bandwith estimation or set the 
argument leaveoneout=FALSE.

Cheers,

Marcelino


El 22/10/2013 14:37, David Villalobos escribió:
> Hi Rolf and Julia
>
>
> Many thanks for your help, I appreciate that. I am sorry for the
> inconvenient, I am new in these things.
>
>
> Just to clarify, my window is complex because is created from a
> "shapefile" that delimit my study area.  This study area (called "W" in
> the analysis) have the spatial locations of my data ("ficus" and "tienda").
>
>
> With the purpose of reproduce the analysis and try to find the problem,
> in the attachment documents you can find the "shapefile" of my study
> area, a "txt" document of my data and my R script (Kcrossinhom(DV)).
>
>
> Again, I really appreciate your help. Thank you.
>
>
> Cheers
>
>
>
> 2013/10/21 Julia Chacon Labella <juliachacon at gmail.com
> <mailto:juliachacon at gmail.com>>
>
>     Yes, I tried to reproduced your example, and I didn´t have any
>     problem. Have you check how are your lambdas?? Why are you using "at
>     points" instead of the default "by pixel"??
>
>     It seems that could be the lambda values what is wrong. Try to
>     visualized them, and try with the pixel image.
>
>     Other option is to built a new window for your pattern. How did you
>     built it?
>
>
>
>     2013/10/22 Rolf Turner <r.turner at auckland.ac.nz
>     <mailto:r.turner at auckland.ac.nz>>
>
>
>
>         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
>             <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 <mailto: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>
>
>
>         _________________________________________________
>         R-sig-Geo mailing list
>         R-sig-Geo at r-project.org <mailto: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>
>
>
>
>
>     --
>     Julia
>
>
>
>
> --
>
> Saludos
>
> David Villalobos Chaves
> Maestría Académica en Biología
> Universidad de Costa Rica
>
>
> _______________________________________________
> 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