Re: [R] [R-sig-Geo] Comparing spatial point patterns - Syrjala test

From: jiho <>
Date: Sun, 10 Feb 2008 19:30:03 +0100


I went ahead and implemented something. However: - I cannot garantie it gives correct results since, unfortunately, the data used in Syrjala 1996 is not published along with the paper. To avoid mistakes, I started by coding things in a fast and simple way and then tried to optimize the code. At least all versions given the same results.
- As expected, the test is still quite slow since it relies on permutations to compute the p.value. The successive optimizations allowed to go from 73 to 13 seconds on my machine, but 13 seconds is still a long time. Furthermore, I don't know how the different versions would scale according to the number of points (I only tested with one dataset). I'm not very good at "thinking vector" so if someone could look at this and further improve it, I would welcome patches. Maybe the only real solution would be to go the Fortran way and link some code to R, but I did not want to wander in such scary places ;)

The code and test data is here: Warning: it probably uses non canonical S syntax, sorry for those with sensitive eyes.

On 2008-February-10 , at 17:02 , Jan Theodore Galkowski wrote:
> I'm also interested here in comparing spatial point patterns. So, if
> anyone finds any further R-based, or S-plus-based work on the
> matter, or
> any more recent references, might you please include me in the
> distribution list?

> Thanks much!

Begin forwarded message:
> From: jiho <>
> Subject: Comparing spatial point patterns - Syrjala test

> Dear Lists,
> At several stations distributed regularly in space[1], we sampled
> repeatedly (4 times) the abundance of organisms and measured
> environmental parameters. I now want to compare the spatial
> distribution of various species (and test wether they differ or
> not), or to compare the distribution of a particular organism with
> the distribution of some environmental variable.
> Syrjala's test[2] seems to be appropriate for such comparisons. The
> hamming distance is also used (but it is not associated with a
> test). However, as far as I understand it, Syrjala's test only
> compares the distribution gathered during one sampling event, while
> I have four successive repeats and:
> - I am interested in comparing if, on average, the distributions are
> the same
> - I would prefer to keep the information regarding the variability
> of the abundances in time, rather than just comparing the means,
> since the abundances are quite variable.

> Therefore I have two questions for all the knowledgeable R users on
> these lists:
> - Is there a package in which Syrjala's test is implemented for R?
> - Is there another way (a better way) to test for such differences?

> Thank you very much in advance for your help.

> [1]
> [2]



______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 10 Feb 2008 - 18:35:57 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 10 Feb 2008 - 19:30:13 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive