rpcp | R Documentation |
Generate one (or several) realisation(s) of the Poisson cluster process in a region
S\times T
.
rpcp(s.region, t.region, nparents=NULL, npoints=NULL, lambda=NULL,
mc=NULL, nsim=1, cluster="uniform", dispersion, infectious=TRUE,
edge = "larger.region", larger.region=larger.region, tronc=1,...)
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 |
nparents |
Number of parents. If |
npoints |
Number of points to simulate. If |
lambda |
Intensity of the parent process. Can be either a numeric
value, a function, or a 3d-array (see |
mc |
Average number of children per parent. It is used when
|
nsim |
Number of simulations to generate. |
cluster |
Distribution of children: “uniform”, “normal” and “exponential” are currently implemented. Either a single value if the distribution in space and time is the same, or a vector of length 2, giving first the spatial distribution of children and then the temporal distribution. |
dispersion |
Scale parameter. It equals twice the standard deviation of location of children relative to their parent for a normal distribution of children; the mean for an exponential distribution and half range for an uniform distribution. |
infectious |
If |
edge |
Specify the edge correction to use "larger.region" or "without". |
larger.region |
By default, the larger spatial region is the convex hull
of |
tronc |
Parameter of the truncated exponential distribution for the distribution of children. |
... |
Additional parameters of the intensity of the parent process. |
A list containing:
xyt |
Matrix (or list of matrices if |
s.region , t.region |
Parameters passed in argument. |
Edith Gabriel <edith.gabriel@inrae.fr>, Peter J Diggle.
plot.stpp
, animation
and stan
for plotting space-time point patterns.
# homogeneous Poisson distribution of parents
data(northcumbria)
pcp1 <- rpcp(nparents=50, npoints=500, s.region=northcumbria,
t.region=c(1,365), cluster=c("normal","exponential"),
maxrad=c(5000,5))
animation(pcp1$xyt, s.region=pcp1$s.region, t.region=pcp1$t.region,
runtime=5)
# inhomogeneous Poisson distribution of parents
lbda <- function(x,y,t,a){a*exp(-4*y) * exp(-2*t)}
pcp2 <- rpcp(nparents=50, npoints=500, cluster="normal", lambda=lbda,
a=4000/((1-exp(-4))*(1-exp(-2))))
plot(pcp2$xyt, style="elegant")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.