Learn R Programming

poisson (version 1.0)

nhpp.event.times: Simulate non-homogeneous Poisson process event times

Description

Randomly simulate the num.events consecutive event times of a non-homogeneous poisson process. Events are simulated using an underlying homogeneous process with given rate. An event at time t is admitted with probability prob.func(t). Note: The rate parameter of an homogeneous process is often called lambda.

Usage

nhpp.event.times(rate, num.events, prob.func, num.sims = 1, t0 = 0)

Arguments

rate
the rate at which events occur in the equivalent homogeneous Poisson process, aka lambda
num.events
number of event times to simulate in each process
prob.func
aka intensity function, function that takes time as sole argument and returns value between 0 and 1
num.sims
number of simulated paths to create
t0
the reference start time of all events

Value

else, a num.events by num.sims matrix

Details

This method is called 'thinning' by Lewis & Shedler (1978).

References

Lewis & Shedler, Simulation of Non-Homogeneous Poisson Processes by Thinning, 1978

See Also

nhpp.mean.event.times, nhpp.scenario, hpp.event.times

Examples

Run this code
rate <- 10
target <- 50
intensity <- function(t) pmin(t/3, 1)
nhpp.event.times(rate, target, intensity)

Run the code above in your browser using DataLab