[R-sig-Geo] existance of a specific non-overlapping marked spatial model in spatstat or other R package?
Adrian.Baddeley at csiro.au
Adrian.Baddeley at csiro.au
Fri May 28 14:04:16 CEST 2010
Jan Quets <Jan.Quets at ua.ac.be> writes:
> I am looking for a specific non-overlapping marked spatial model for use as a null model
> for monte carle simulations with use of the 'envelope' function in spatstat.
> the specific marked spatial model should:
> *generate a spatial random pattern with a predetermined number of points (with conditions set below)
> *each point should be assigned a mark randomly out of a predetermined set of marks
> *these marks represent the radia of circular discs which should be drawn around these points
> (which act as centres)
> *no discs should overlap
If the 'predetermined set of marks' is a finite set of radii, then this is a special case of the multitype Strauss process, where you set the interaction distance between mark r1 and mark r2 to be r1+r2, and the interaction parameters gamma are all equal to zero.
Suppose 'rvals' is a vector containing the desired radii, 'W' is the simulation window and 'b' is the base intensity. Then do
m <- length(rvals)
types <- 1:m
rmat <- outer(rvals, rvals, "+")
gmat <- matrix(0, m, m)
mod <- rmhmodel(cif="straussm", par=list(beta=rep(b, m), gamma=gmat, radii=rmat), w=W)
This defines the model. Then if you want simulations of exactly k points,
sta <- rmhstart(n.start=k)
con <- rmhcontrol(p=1)
If you now call
X <- rmh(mod, sta, con)
you'll get a multitype point pattern with marks 1:m where mark j corresponds to radius rvals[j]. If you need to convert this to a marked point pattern with the radii as the marks, do something like
marks(X) <- rvals[marks(X)]
To use this in envelope(), set
mapmarks <- function(X, v=rvals) { marks(X) <- v[marks(X)]; return(X) }
expr <- expression(mapmarks(rmh(mod, sta, con)))
then call
envelope(....... simulate=expr)
If the 'predetermined set of marks' is a continuous range of radii, then there does exist some code to do this, but it is not yet released in spatstat.
Adrian Baddeley
More information about the R-sig-Geo
mailing list