Skip to content
Back to formatted view

Raw Message

Message-ID: <5045537E.8020802@xtra.co.nz>
Date: 2012-09-04T01:03:58Z
From: Rolf Turner
Subject: adding points to a point pattern
In-Reply-To: <!&!AAAAAAAAAAAYAAAAAAAAANurYWtafkREnWeH4rBeYRHigQAAEAAAAHJnoiMpnLhBkCXM6i5hLe8BAAAAAA==@gmail.com>

On 04/09/12 11:58, Frederico Mestre wrote:
> Hello all:
>
>   
>
> Is there any way to add points to a point pattern, while keeping a given
> minimum distance amongst this new points and the pre-existing points?
>

Presumably this is a question about the "spatstat" package.

If so, the answer is "yes".  At least two ways:

(1) Using rmh() --- need to specify "beta" (the "chemical" activity
parameter).  E.g.

# Generate a "test pattern" to which to add points.
set.seed(42)
X <- rSSI(0.05,100)

# Add points.
M <- rmhmodel(cif="hardcore",par=list(beta=300,hc=0.05))
Y  <- 
rmh(M,start=list(x.start=X),expand=1,control=list(x.cond=as.data.frame(X)))
plot(Y,main="Pattern with points added via rmh")
plot(X,add=TRUE,chars=20,cols="red")
print(min(nndist(Y)))

(2) Using rSSI() --- need to specify the *total number* of points 
desired.  E.g.

# Add points to the same "test pattern", in a different way.
Z <- rSSI(0.05,npoints(X)+42,x.init=X)
plot(Z,main="Pattern with points added via rSSI")
plot(X,add=TRUE,chars=20,cols="red")
print(min(nndist(Z)))

HTH

     cheers,

         Rolf Turner