[R-sig-Geo] How to estimate LGCP parameters for replicated point pattern

Adrian Baddeley adrian.baddeley at uwa.edu.au
Tue Dec 17 03:22:32 CET 2013


Hugues Santin-Janin writes:

> Is it possible to use the kppm function to estimate the parameters
>  beta0, beta1, beta2, beta3, sigma2 and kappa based on the whole dataset 
> (i.e., using the three replicates P1, P2 and P3) ?

This can be done by pooling the K-functions and using lgcp.estK.

First use 'mppm' to estimate the trend parameters beta*. 

     Data <- hyperframe(Points=list(P1,P2,P3))
     fit <- mppm(Points ~ polynom(x,2) + y, data=Data)

Then use predict.mppm to compute the fitted intensity.

    Lam <- predict(fit)
    Data$Lambda <- Lam

Then use Kinhom to estimate the inhomogeneous K-functions for each of the
patterns P1, P2, P3.

     K <- with(Data, Kinhom(Points, Lambda))

At the moment, these functions must be pooled by hand.
Use weights proportional to n*(n-1) where
n is the number of points in each pattern. 

     n <- with(Data, npoints(Points))
     nn1 <- n * (n-1)
     
     K1 <- K[[1]]
     K2 <- K[[2]]
     K3 <- K[[3]]
     Kpool <- eval.fv( (K1 * nn1[1]  + K2 * nn1[2] + K3 * nn1[3])/sum(nn1))
    
Finally 

     mod <- lgcp.estK(Kpool)


In future, mppm() will be able to do this.

Prof Adrian Baddeley FAA
University of Western Australia
________________________________________
From: Rolf Turner [r.turner at auckland.ac.nz]
Sent: Tuesday, 17 December 2013 9:21 AM
To: hugues Santin-Janin
Cc: r-sig-geo at r-project.org; Adrian Baddeley
Subject: Re: [R-sig-Geo] How to estimate LGCP parameters for replicated point pattern

Good question!  (And very clearly expressed.)  I think that the answer
to "Is there
any way ....?" is currently "no".  We have mppm() which will fit a model
to independent
replicate patterns assumed to arise from a ***Gibbs*** model, but this
function
does not work for models arising from clustering mechanisms, which get
fitted via
the method of minimum contrast.  (Using, as you have noted, kppm().)

I'm not sure how hard (or easy!) it would be to add such a facility.  I
would guess
not ***too*** hard, but my guesses have sometimes been known to be horribly
wrong.  Adrian B., to whom I am cc-ing this message, will know off the
top of his
head.  In any event I think a substantial amount of effort would be
required to
add this facility, and it would take time.

     cheers,

     Rolf Turner

On 16/12/13 22:01, hugues Santin-Janin wrote:
> Dear all,
>
>
>
> Let P1, P2 and P3 to be 3 realizations of a Log Gaussian Cox Process, say:
>
>
>
> #Setting parameter values
>
> sigma2 <- 1
>
> kappa <- 1
>
> beta0 <-  3
>
> beta1 <-  4.5
>
> beta2 <- -1.5
>
> beta3 <- 2.5
>
>
>
> ## spatstat_1.33-0
>
> ##R  3.0.1
>
> library(spatstat)
>
>
>
> m <- as.im(function(x, y){beta0 + beta1 * x + beta2 * (x^2) + beta3 * y},
> W=owin())
>
>
>
> #Generating replicated point patterns
>
> set.seed(1)
>
> P1 <- rLGCP("matern", m, c(0, variance=sigma2, nugget=0, scale=1/kappa,
> nu=1))
>
> set.seed(2)
>
> P2 <- rLGCP("matern", m, c(0, variance=sigma2, nugget=0, scale=1/kappa,
> nu=1))
>
> set.seed(3)
>
> P3 <- rLGCP("matern", m, c(0, variance=sigma2, nugget=0, scale=1/kappa,
> nu=1))
>
>
>
>
>
> Considering either replicate P1, P2 or P3, estimates of the parameters
> beta0, beta1, beta2, eta3, sigma2 and kappa can be obtained using the kppm
> function:
>
>
>
> Q1 <- quadscheme(P1)
>
> Est1 <- kppm(Q1, trend=~polynom(x, 2) + y, cluster= "LGCP", method="clik",
> covmodel=list(model="matern", nu=1))
>
>
>
> Is is possible (and if yes how) to use the kppm function, or any other R
> function,  to estimate the parameters beta0, beta1, beta2, beta3, sigma2 and
> kappa based on the whole dataset (i.e., using the three replicates P1, P2
> and P3) ?



More information about the R-sig-Geo mailing list