vdraw_sc_step_regular {nhppp}R Documentation

Vectorized sampling from NHPPPs with piecewise constant intensities with same interval lengths (R)

Description

Simulate 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,
  range_t = c(0, 10),
  tol = 10^-6,
  atmost1 = FALSE,
  atleast1 = FALSE,
  use_cpp = TRUE
)

Arguments

Lambda_matrix

(matrix) integrated intensity rates at the end of each interval

lambda_matrix

(matrix) intensity rates, one per interval

range_t

(vector, double) t_min and t_max

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 (zero-truncated NHPPP)

use_cpp

(boolean, TRUE) use the C++ implementation of the function

Value

a vector of event times t if no events realize, it will have 0 length

Examples

x <- vdraw_sc_step_regular(Lambda_matrix = matrix(1:5, nrow = 1))

[Package nhppp version 0.1.4 Index]