Learn R Programming

stpp (version 2.0-8)

rpcp: Generate Poisson cluster point patterns

Description

Generate one (or several) realisation(s) of the Poisson cluster process in a region \(S\times T\).

Usage

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,...)

Value

A list containing:

xyt

Matrix (or list of matrices if nsim>1) containing the points \((x,y,t)\) of the simulated point pattern. xyt (or any element of the list if nsim>1) is an object of the class stpp.

s.region, t.region

Parameters passed in argument.

Arguments

s.region

Two-column matrix specifying polygonal region containing all data locations. If s.region is missing, the unit square is considered.

t.region

Vector containing the minimum and maximum values of the time interval. If t.region is missing, the interval \([0,1]\) is considered.

nparents

Number of parents. If NULL, nparents is from a Poisson distribution with intensity lambda.

npoints

Number of points to simulate. If NULL (default), the number of points is from a Poisson distribution with mean the double integral of the intensity over s.region and t.region.

lambda

Intensity of the parent process. Can be either a numeric value, a function, or a 3d-array (see rpp). If NULL, it is constant and equal to nparents / volume of the domain.

mc

Average number of children per parent. It is used when npoints is NULL.

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 TRUE, offspring's times are always greater than parent's time.

edge

Specify the edge correction to use "larger.region" or "without".

larger.region

By default, the larger spatial region is the convex hull of s.region enlarged by the spatial related value of dispersion and the larger time interval is t.region enlarged by the temporal related value of dispersion. One can over-ride default using the 2-vector parameter larger.region.

tronc

Parameter of the truncated exponential distribution for the distribution of children.

...

Additional parameters of the intensity of the parent process.

Author

Edith Gabriel <edith.gabriel@inrae.fr>, Peter J Diggle.

See Also

plot.stpp, animation and stan for plotting space-time point patterns.

Examples

Run this code
# 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))
# \donttest{
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")

Run the code above in your browser using DataLab