# ragsMultiHard

##### Alternating Gibbs Sampler for Multitype Hard Core Process

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

##### Usage

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

##### Arguments

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

- hradii
Matrix of hard core radii between each pair of types. Diagonal entries should be

`0`

or`NA`

.- types
Vector of all possible types for the multitype point pattern.

- …
Arguments passed to

`rmpoispp`

when generating random points.- bmax
Optional upper bound on

`beta`

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

- ncycles
Number of cycles of the sampler to be performed.

##### Details

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.

##### Value

A point pattern (object of class `"ppp"`

).

##### See Also

##### Examples

```
# NOT RUN {
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.61-0, License: GPL (>= 2)*