Simulates event times from a (one-dimensional, homogeneous) Poisson process
of rate \(\lambda\) per hour. The user has the options to simulate events
over a fixed time period of hours
hours or to simulate a fixed number
n_events
of events.
poisson_process_sim(lambda = 1, hours = 24, n_events = NULL)
A numeric vector containing the (ordered, smallest to largest) times at which the events occur. The returned object has class "poisson_process".
If n_events
is supplied then exactly n_events
are
simulated and hours
has no effect. If n_events
is not
supplied then events are simulated over the time interval
(0, hours
). If no events occur in (0, hours
) then
the value \(-1\) is returned.