Skip to contents

This function simulates a double-censored probability mass function (PMF). The user may specify the alpha, beta, and upper bound of the event times. Additionally, the user can specify the random number generator functions for primary events, secondary events, and delays.

Usage

simulate_double_censored_pmf(
  alpha,
  beta,
  max,
  n = 1000,
  rprimary = function(x) (runif(x, 0, 1)),
  rdelay = rlnorm,
  delay_obs_process = function(s, p) (floor(s) - floor(p))
)

Arguments

alpha

The shape parameter of the delay distribution.

beta

The scale parameter of the delay distribution.

max

The upper bound of event time.

n

The total number of cases to simulate.

rprimary

Random number generator function for primary events. Defaults to runif.

rdelay

Random number generator function for delays. Defaults to rlnorm().

delay_obs_process

Observation process for delays. Defaults to using the floor function to round both primary and secondary events to the nearest integer. Internally the delay is also bounded to be non-negative.

Value

A probability mass function that represents the distribution of the delays.