
Generic function for simulating from NHPPPs given the intensity function.
Source:R/draw_intensity.R
draw_intensity.RdSample from NHPPPs given the intensity function This is a wrapper to the package's specific functions, and thus somewhat slower. For time-intensive simulations prefer one of the specific functions.
Usage
draw_intensity(
lambda,
line_majorizer_intercept = NULL,
line_majorizer_slope = NULL,
line_majorizer_is_loglinear = FALSE,
step_majorizer_vector = NULL,
t_min = NULL,
t_max = NULL,
atmost1 = FALSE
)Arguments
- lambda
(function) the instantaneous rate
- line_majorizer_intercept
The intercept
alphaof the loglinear majorizer function:alpha + beta * torexp(alpha + beta * t)- line_majorizer_slope
The slope
betaof the loglinear majorizer function:alpha + beta * torexp(alpha + beta * t)- line_majorizer_is_loglinear
(boolean) if
TRUEthe majorizer is loglinearexp(alpha + beta * t); ifFALSEit is a linear function- step_majorizer_vector
(vector, double)
Kconstant majorizing rates, one per interval; all intervals are of equal length (regular)- t_min
(double) the lower bound of the interval
- t_max
(double) the upper bound of the interval
- atmost1
boolean, draw at most 1 event time