rpcp: Generate Poisson cluster point patterns

Description Usage Arguments Value Author(s) See Also Examples

View source: R/rpcp.r

Description

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

Usage

1
2
3
 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,...)

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.

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.

Author(s)

Edith Gabriel <edith.gabriel@univ-avignon.fr>, Peter J Diggle.

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# 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))
## Not run: 
animation(pcp1$xyt, s.region=pcp1$s.region, t.region=pcp1$t.region,runtime=5)

## End(Not run)
# 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))))
## Not run: 
stan(pcp2$xyt)

## End(Not run)

stpp documentation built on May 2, 2019, 4:50 p.m.