simNHPc: Generating points in a Poisson process

Description Usage Arguments Details Value References See Also Examples

Description

This function generates the occurrence points in a homogenous or nonhomogeneous Poisson process (NHPP) with a given intensity λ(t), in a continuous period of time (0, T).

It calls the auxiliary function buscar (not intended for the users), see Details.

Usage

1
simNHPc(lambda, fixed.seed=NULL, algor="Thinning")

Arguments

lambda

Numeric vector. Intensity λ(t) used to generate the Poisson process. Its length determines the length of the observed period.

fixed.seed

An integer or NULL. If it is an integer, that is the value used to set the seed in random generation processes. It it is NULL, a random seed is used.

algor

Optional. Character string. The algorithm used to generate the process, it can be "Inversion" or "Thinning"; see Details.

Details

Two algorithms to generate the NHPP points are implemented. "Inversion" is based on the inversion algortihm, see Ross(2006), and it consists in two steps. First, the points of a homogeneous Poisson process of intensity one are generated using independent exponentials. Then, the homogeneous occurrence times are transformed into the points of a nonhomogeneous process with intensity λ(t). This transformation is performed by the auxiliary function buscar (not intended for the user).

The algorithm "Thinning", see Banerjee et al. (2014), generates the occurrences times in a homogeneous Poisson process with intensity λ_{max}=\max_t λ(t) and the resulting points are retained with probability λ(t_i)/λ_{max}.

The "Inversion" algorithm requires positive values of the argument lambda and it is slower, but the "Thinning" algorithm may yield excesive rejection according to Ross (2006).

The lenght of the period where the processes are generated is determined by the length of the argument lambda.

Homogenous processes are generated if the intensity vector lambda is constant (that is if all the values are equal).

Value

A list with elements:

posNH

Numeric vector. Occurrence points of the Poisson process.

lambda

Input argument.

fixed.seed

Input argument.

References

Banerjee, S., Carlin, B.P. and Gelfand, A. E. (2014) Hierarchical modeling and analysis for spatial data.CRC Press.

Ross, S.M. (2006). Simulation. Academic Press.

See Also

simHPc, IndNHPP

Examples

1
2
3
4
5
6
7
8
9
#Generation  of a Homogeneous Poisson process 
aux<-simNHPc(lambda=rep(0.1,200),fixed.seed=123, algor='Inversion')
aux$posNH

#Generation of a NHPP 
set.seed(123)
lambdat<-runif(500, 0.01,0.1)
aux<-simNHPc(lambda=lambdat,fixed.seed=123, algor='Thinning')
aux$posNH

IndTestPP documentation built on Aug. 29, 2020, 1:06 a.m.