
Vectorized sampling from NHPPPs with piecewise constant intensities with same interval lengths
Source:R/vdraw_sc_step_regular.R
vdraw_sc_step_regular.RdSimulate a piecewise constant-rate Poisson Point Process over (t_min, t_max] (inversion method)
where the intervals have the same length (are "regular").
Usage
vdraw_sc_step_regular(
lambda_matrix = NULL,
Lambda_matrix = NULL,
rate_matrix_t_min = NULL,
rate_matrix_t_max = NULL,
t_min = NULL,
t_max = NULL,
tol = 10^-6,
atmost1 = FALSE,
report_first_K = NULL,
report_last_K = NULL,
atleast1 = FALSE,
generate_at_least_K = NULL,
generate_at_most_K = NULL,
budget_cap = NULL,
atmostB = NULL,
output = c("matrix", "long")
)Arguments
- lambda_matrix
(matrix) intensity rates, one per interval
- Lambda_matrix
(matrix) integrated intensity rates at the end of each interval
- rate_matrix_t_min
(scalar | vector | column matrix) is the lower bound of the time interval for each row of (Lambda|lambda)_maj_matrix. The length of this argument is the number of point processes that should be drawn.
- rate_matrix_t_max
(scalar | vector | column matrix) the upper bound of the time interval for each row of (Lambda|lambda)_maj_matrix. The length of this argument is the number of point processes that should be drawn.
- t_min
(scalar | vector | column matrix) is the lower bound of a subinterval of (rate_matrix_t_min, rate_matrix_t_max]. If set, times are sampled from the subinterval. If omitted, it is equivalent to
rate_matrix_t_min.- t_max
(scalar | vector | column matrix) is the upper bound of a subinterval of (rate_matrix_t_min, rate_matrix_t_max]. If set, times are sampled from the subinterval. If omitted, it is equivalent to
rate_matrix_t_max.- tol
(scalar, double) tolerance for the number of events
- atmost1
boolean, report at most 1 event time (alias for
report_first_K = 1)- report_first_K
NULLor a positive integer: report only the earliest K event times (a reporting truncation — the count law of the sampled process is unchanged). At most one ofreport_first_K/report_last_Kmay be set.- report_last_K
NULLor a positive integer: report only the latest K event times (ascending order; reporting truncation).- atleast1
boolean, condition on at least 1 event (alias for
generate_at_least_K = 1)- generate_at_least_K
NULLor a positive integer: condition the sampled process on at least K events in the (sub)interval (order-statistics sampling path).- generate_at_most_K
NULLor a positive integer: condition the sampled process on at most K events. May be combined withgenerate_at_least_K(K1 <= K2; K1 = K2 conditions on exactly K events).- budget_cap
NULLor a positive integer: cap the computational event budget of the kernel. This is an approximation knob (it truncates the extreme tail of the event-count distribution together with the1 - tolquantile bound), not an exact reporting or conditioning contract.- atmostB
deprecated alias for
budget_cap.- output
(string)
"matrix"(default) for the NA-padded event matrix or"long"for the long event formatlist(id, time, n_draws); seevdraw_sc_step().
Value
a matrix of event times t, with rows corresponding to the sampled
point processes, or the long event format if output = "long"
if no events realize, it will have 0 length
Examples
x <- vdraw_sc_step_regular(
Lambda_matrix = matrix(1:5, nrow = 1),
rate_matrix_t_min = 100,
rate_matrix_t_max = 110
)