Search code examples
rspatstat

How to convert a Mean Cluster size result that is in [pixel image] to the number of mean points per cluster in spatstat?


Given a inhomogeneous cluster model, associated with a variable Z as an object of class 'im', how to convert the result of the number of mean points per cluster (Mean cluster size) in pixel image to the average number of individuals per cluster?

For example, in the inhomogeneous fitting cluster of Beilschmiedia data:

> fitBeiThom <- kppm(bei ~ elev + grad, "Thomas", data=bei.extra)
> fitBeiThom
Inhomogeneous cluster point process model
Fitted to point pattern dataset ‘bei’
Fitted by minimum contrast
    Summary statistic: inhomogeneous K-function

Log intensity:  ~elev + grad

Fitted trend coefficients:
(Intercept)        elev        grad 
-8.56355220  0.02143995  5.84646680 

Cluster model: Thomas process
Fitted cluster parameters:
       kappa        scale 
5.021718e-05 2.737983e+01 
Mean cluster size:  [pixel image]

Cluster strength: phi =  2.114
Sibling probability: psib =  0.6789

In this context, what would be the exact value of the number of midpoints per cluster and how to obtain it?


Solution

  • The size of a single cluster is not well-defined for an inhomogeneous cluster model. It depends on where in the window you place the parent point that generates the cluster. Below is an example generating a small hexagonal grid of cluster centers and the corresponding plot of (superimposed) clusters for your fitted model. In principle the contribution of a single cluster extends over the entire region in the Thomas model, but the tails decay exponentially fast, and with the given parameters and cluster centers in this example it will make no pracitally difference whether you consider them separately or superimposed.

    library(spatstat)
    fitBeiThom <- kppm(bei ~ elev + grad, "Thomas", data=bei.extra)
    gridBei <- hexgrid(bei, s = 100)
    clusters <- clusterfield(fitBeiThom, locations = gridBei)
    plot(clusters)
    integral(clusters)/npoints(gridBei)
    #> [1] 142.8573
    plot(clusters)