Search code examples
rspatstat

Fitting an inhomogeneous Cox LGCP to a replicated point process using mppm


My recent foray into spatial point patterns has brought me to examining LGCP Cox processes. In my case I actually have a series of point patterns that I want to fit a single model to. One of my previous inquiries brought me to using mppm to train such models( thanks Adrian Baddeley!). My next question relates to using this type of Cox model in the context of mppm.

Is this possible to fit an inhomogeneous LGCP Cox process (or other type of Cox process) to a replicated point pattern using mppm? I see some info on fitting Gibbs processes, but not really for Cox processes. It seems like the answer may be "possibly" through some creative use of the "random" argument.

For the sake of example, lets say I'm fitting a using point pattern Y with a single covariate X (which is a single im). The call to kppm would be:

myModel = kppm(Y ~ X,"LGCP")

If I were fitting a simple inhomogeneous Poisson process to a replicated point pattern and associated covariate in hyperframe G, I believe the call would look like the following:

myModel = mppm(Y ~ X, data=G)

After going through Chapter 16 of the SpatStat book I think that fitting a replicated LGCP Cox model might be accomplished by using the simulated intensities from calls to rLGCP, maybe like this...

myLGCP = rLGCP(model="exp",mu=0,saveLambda=TRUE,nsim=2,win=myWindow)
myIntensity = lapply(myLGCP,function(x) attributes(x)$Lambda)
G$Z = myIntensity

myModel = mppm(Y ~ X, data=G, random=~Z|id)

The above approach "runs" without errors... but I have no idea if I'm even remotely close to actually accomplishing what I wanted to do. It's also a little unclear how to use the fitted object to then simulate a realization of the model, since simulate.kppm requires a kppm object.

Thoughts and suggestions appreciated.


Solution

  • mppm does not currently support Cox processes.

    You could do the following

    1. Fit the trend part of the model to your replicated point pattern data using mppm, for example m <- mppm(Y ~ X, data=G)

    2. Extract the fitted intensities for each point pattern using predict.mppm

    3. For each point pattern, using the corresponding intensity obtained from the model, compute the inhomogeneous K function using Kinhom (with argument ratio=TRUE)

    4. Combine the K functions using pool

    5. Estimate the cluster parameters of the LGCP by applying lgcp.estK to the pooled K function.

    Optionally after step 4 you could convert the pooled K function to a pair correlation function using pcf.fv and then fit the cluster parameters using lgcp.estpcf.

    This approach assumes that the same cluster parameters will apply to each point pattern. If your data consist of several distinct groups of patterns, and you want the model to assign different cluster parameter values to the different groups of patterns, then just apply steps 4 and 5 separately to each group.