vdraw {nhppp} | R Documentation |
Vectorized generic function for simulating from NHPPPs given the intensity function or the cumulative intensity function
Description
This is a wrapper to the package's specific functions, and thus slightly slower. For time-intensive simulations prefer one of the specific functions.
Usage
vdraw(
lambda = NULL,
lambda_args = NULL,
Lambda_maj_matrix = NULL,
lambda_maj_matrix = NULL,
range_t = NULL,
tol = 10^-6,
atmost1 = FALSE,
atleast1 = FALSE,
use_cpp = FALSE
)
Arguments
lambda |
(function) a vectorized intensity function, with one or two arguments.
The first is time. The optional second (should be named |
lambda_args |
(list) optional list of named arguments for |
Lambda_maj_matrix |
(matrix) for the majorizeintegrated intensity rates at the end of each interval |
lambda_maj_matrix |
(matrix) intensity rates, one per interval |
range_t |
(vector, or matrix) |
tol |
(scalar, double) tolerance for the number of events |
atmost1 |
boolean, draw at most 1 event time |
atleast1 |
boolean, draw at least 1 event time in interval |
use_cpp |
boolean, use C++ code |
Value
a vector of event times
Examples
Z <- vdraw(
lambda = function(x, lambda_args = NULL) 0.1 * x,
range_t = c(1, 10),
lambda_maj_matrix = matrix(rep(1, 5), nrow = 1),
atmost1 = FALSE, atleast1 = FALSE, use_cpp = TRUE
)
[Package nhppp version 0.1.4 Index]