Learn R Programming

SimRVPedigree (version 0.4.4)

get_wait_time: obtain the waiting time to the next event

Description

get_wait_time approximates the result of the inverse cumulative distribution function of the waiting time to the next event associated with a non-homogeneous Poisson process conditioned of the time of the last event.

Usage

get_wait_time(p, last_event, hazard, part, scale = FALSE)

Arguments

p

Numeric. A probability; i.e. the argument of the quantile function of the waiting time associated with a non-homogeneous Poisson process with rate hazard.

last_event

A positive number. The time at last event.

hazard

A vector of positive numbers. The time-specific hazard rate.

part

A vector of positive numbers. Time partition over which to apply the time-specific hazard rate.

scale

Logical. By default scale = FALSE. Specifying scale = TRUE ensures that this function is the quantile function for a proper random variable.

Value

The waiting time to next event, units same as those in part.

Details

get_wait_time obtains the waiting time to next event associated with a non-homogeneous Poisson process. The units of the simulated waiting time are the units specified in part, i.e. if part is specified in years, the simulated waiting time is in years.