[R-sig-Geo] [R-sig-geo] can a (modified) pairdist() output be used as a basis for calculating a pcf

Quets Jan Jan.Quets at ua.ac.be
Mon Aug 29 21:47:33 CEST 2011


could you in short describe what you mean by rescaling?

is this rescaling also needed when comparing this 'modified-pcf' relative to an envelope of 'modified-pcfs' which resulted from simulations of an appropriate nullmodel (i.e. random non-overlapping circles)?

I have indeed to be cautious what the implications are of these modifications...,  

Van: Adrian.Baddeley at csiro.au [Adrian.Baddeley at csiro.au]
Verzonden: maandag 29 augustus 2011 6:01
Aan: r-sig-geo at r-project.org
CC: Quets Jan; Adrian.Baddeley at csiro.au; r.turner at auckland.ac.nz
Onderwerp: [R-sig-geo] can a (modified) pairdist() output be used as a basis for calculating a pcf

Jan Quets <Jan.Quets at ua.ac.be> heeft geschreven:

> suppose that I want to change the pcf function in such a way that it
> doesn't 'use' the distribution of point-to-point distances,
> but instead 'uses' the distribution of edge-to-edge distances.
>  [ ... ]
> is it possible in spatstat to [... ] calculate the (modified)-pcf
> in an easy way by use of some specific spatstat functions?

        As a temporary measure, you could use the (currently undocumented)
      function 'compilepcf'.
        You need something like the following invocation:

           f <- compilepcf(D, r=handle.r.b.args(window=W))

      where D is the pairwise distance matrix, and W is the window containing the
      data. The result is an 'fv' class object. You may have to rescale it
      using eval.fv.

      Of course you'll need to think carefully about what this calculation means,
      in order to decide how to rescale it, etc.

      For the usual pair correlation function, you would have to subsequently
      divide f(r) by 2 * pi * r. This normalisation is not carried out by 'compilepcf'.

      This will not work in spatstat 2 where we will have a different mechanism that
      is faster.

> to calculate a square matrix of edge-to-edge distances (E2E):
> for (i in 1:100){
> for (j in 1:100){
>  sumradii[i,j] = vmrad$marks[i] + vmrad$marks[j]
> }
> }
> E2E = pairdist(vmrad) - sumradii

      You can do this faster using

        sumradii <- outer(marks(vmrad), marks(vmrad), "+")

      You will also need to reset the diagonal of 'E2E' to infinity so that it
      is not used:

         diag(E2E) <- Inf

Adrian Baddeley

More information about the R-sig-Geo mailing list