Learn R Programming

poisson (version 1.0)

nhpp.sim.slow: Simulate a non-homogeneous Poisson process.

Description

Get the n consecutive event times of a non-homogeneous poisson process.Events are simulated using an homogeneous process with rate, and an event at time t is admitted with probability prob.func(t).

Usage

nhpp.sim.slow(rate, num.events, prob.func, num.sims = 1, t0 = 0, prepend.t0 = T)

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
prepend.t0
T to include t0 at the start of the process

Value

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.scenario, hpp.sim

Examples

Run this code
intensity <- function(t) pmin(t/3, 1)
rate <- 10
num.events <- 100
nhpp.sim.slow(rate, num.events, prob.func=intensity)

Run the code above in your browser using DataLab