draw_intensity_step: Simulate from a non homogeneous Poisson Point Process (NHPPP) from
(t0, t_max) (thinning method) with piecewise constant_majorizer
Description
Sample NHPPP times using the thinning method, optionally using
an rstream
generator
Usage
draw_intensity_step(
lambda,
lambda_maj_vector = lambda(1:10),
times_vector = 0:10,
rng_stream = NULL,
atmost1 = FALSE
)
Value
a vector of event times (t_); if no events realize,
a vector of length 0
Arguments
- lambda
(function) the instantaneous rate of the NHPPP.
A continuous function of time.
- lambda_maj_vector
(scalar, double) K
constant majorizing rates, one per interval
- times_vector
(vector, double) K+1
time points defining K
intervals
of constant rates:
[t_1 = range_t[1], t_2)
: the first interval
[t_k, t_{k+1})
: the k
-th interval
[t_{K}, t_{K+1} = range_t[2])
: the K
-th (last) interval
- rng_stream
(rstream
) an rstream
object or NULL
- atmost1
boolean, draw at most 1 event time
Examples
Run this codex <- draw_intensity_step(lambda = function(t) exp(.02 * t))
Run the code above in your browser using DataLab