Description Usage Arguments Value Author(s) See Also Examples
Generate one (or several) realisation(s) of the inhibition or contagious process in a region S x T.
1 2 3 |
npoints |
number of points to simulate. |
s.region |
two-column matrix specifying polygonal region containing
all data locations.
If |
t.region |
vector containing the minimum and maximum values of
the time interval.
If |
hs, ht |
function which depends on the distance between points
and |
thetas, thetat |
Parameters of |
deltas, deltat |
Spatial and temporal distance of inhibition. |
gs, gt |
Compute the probability of acceptance of a new point from
|
recent |
If “ |
nsim |
number of simulations to generate. Default is 1. |
discrete.time |
if TRUE, times belong to N, otherwise belong to R^+. |
replace |
Logical. If TRUE allows times repeat. |
inhibition |
Logical. If TRUE, an inhibition process is generated. Otherwise, it is a contagious process. |
... |
Additional parameters if |
A list containing:
xyt |
matrix (or list of matrices if |
s.region, t.region |
parameters passed in argument. |
Edith Gabriel <edith.gabriel@univ-avignon.fr>, Peter J Diggle.
plot.stpp
, animation
and stan
for plotting space-time point patterns.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | # simple inhibition process
inh1 = rinter(npoints=200,thetas=0,deltas=0.05,thetat=0,deltat=0.001,inhibition=TRUE)
## Not run: stan(inh1$xyt)
# inhibition process using hs and ht defined by the user
hs = function(d,theta,delta,mus=0.1)
{
res=NULL
a=(1-theta)/mus
b=theta-a*delta
for(i in 1:length(d))
{
if (d[i]<=delta) res=c(res,theta)
if (d[i]>(delta+mus)) res=c(res,1)
if (d[i]>delta & d[i]<=(delta+mus)) res=c(res,a*d[i]+b)
}
return(res)
}
ht = function(d,theta,delta,mut=0.3)
{
res=NULL
a=(1-theta)/mut
b=theta-a*delta
for(i in 1:length(d))
{
if (d[i]<=delta) res=c(res,theta)
if (d[i]>(delta+mut)) res=c(res,1)
if (d[i]>delta & d[i]<=(delta+mut)) res=c(res,a*d[i]+b)
}
return(res)
}
d=seq(0,1,length=100)
plot(d,hs(d,theta=0.2,delta=0.1,mus=0.1),xlab="",ylab="",type="l",
ylim=c(0,1),lwd=2,las=1)
lines(d,ht(d,theta=0.1,delta=0.05,mut=0.3),col=2,lwd=2)
legend("bottomright",col=1:2,lty=1,lwd=2,legend=c(expression(h[s]),expression(h[t])),
bty="n",cex=2)
inh2 = rinter(npoints=100, hs=hs, gs="min", thetas=0.2, deltas=0.1, ht=ht, gt="min",
thetat=0.1, deltat=0.05, inhibition=TRUE)
## Not run: animation(inh2$xyt, runtime=15, cex=0.8)
# simple contagious process for given spatial and temporal regions
data(northcumbria)
cont1 = rinter(npoints=250, s.region=northcumbria, t.region=c(1,200), thetas=0,
deltas=5000, thetat=0, deltat=10, recent=1, inhibition=FALSE)
## Not run:
plot(cont1$xyt,pch=19,s.region=cont1$s.region,mark=TRUE,mark.col=4)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.