Search code examples
rspatstat

Can not find rMatClust parent point attribute


Calling rMatClust() with parameter saveparents=TRUE is not providing with the parent point pattern in the result. How to retrieve the parent points?

I am trying something like the following:

parent.kappa <- function(x,y){ exp(-8.944711 - 4.645625*10^(-5)*x -6.437164*10^(-4)*y)

simulated.ppp <- rMatClust(kappa=parent.kappa, scale=10, mu=5, nsim = 1, win=owin(c(0, 1000), c(0, 1000)), saveLambda=TRUE, saveparents=TRUE)

According to the manual simulated.ppp should have an attribute named parents (a point pattern object) that holds the parent points of the Matern clusters.


Solution

  • I cannot reproduce this problem. When I run your example code using spatstat 1.64-1, the resulting point pattern simulated.ppp does have the desired attribute, attr(simulated.ppp, "parents").

    However, looking at the code for rMatClust, there is one special case where the result could be returned without the attribute "parents". Namely, if the model parameters determine a point process with very weak clustering, then the code calls rpoispp to generate the result. Is it possible that you encountered this situation?

    Please provide an example which demonstrates the problem.