Alternating Gibbs Sampler for Multitype Hard Core Process

Generate a realisation of the multitype hard core point process using the alternating Gibbs sampler.

spatial, datagen
ragsMultiHard(beta, hradii, …, types=NULL, bmax = NULL,
              periodic=FALSE, ncycles = 100)

First order trend. A numeric vector, a pixel image, a function, a list of functions, or a list of pixel images.


Matrix of hard core radii between each pair of types. Diagonal entries should be 0 or NA.


Vector of all possible types for the multitype point pattern.

Arguments passed to rmpoispp when generating random points.


Optional upper bound on beta.


Logical value indicating whether to measure distances in the periodic sense, so that opposite sides of the (rectangular) window are treated as identical.


Number of cycles of the sampler to be performed.


The Alternating Gibbs Sampler for a multitype point process is an iterative simulation procedure. Each step of the sampler updates the pattern of points of a particular type i, by drawing a realisation from the conditional distribution of points of type i given the points of all other types. Successive steps of the sampler update the points of type 1, then type 2, type 3, and so on.

This is an experimental implementation which currently works only for multitype hard core processes (see MultiHard) in which there is no interaction between points of the same type, and for the area-interaction process (see ragsAreaInter).

The argument beta gives the first order trend for each possible type of point. It may be a single number, a numeric vector, a function(x,y), a pixel image, a list of functions, a function(x,y,m), or a list of pixel images.

The argument hradii is the matrix of hard core radii between each pair of possible types of points. Two points of types i and j respectively are forbidden to lie closer than a distance hradii[i,j] apart. The diagonal of this matrix must contain NA or 0 values, indicating that there is no hard core constraint applying between points of the same type.


A point pattern (object of class "ppp").

See Also

rags, ragsAreaInter

  • ragsMultiHard
  b <- c(30,20)
  h <- 0.05 * matrix(c(0,1,1,0), 2, 2)
  ragsMultiHard(b, h, ncycles=10)
  ragsMultiHard(b, h, ncycles=5, periodic=TRUE)
# }
Documentation reproduced from package spatstat, version 1.52-1, License: GPL (>= 2)

Community examples

Looks like there are no examples yet.