exp_icdf {cpsurvsim}R Documentation

Inverse CDF for the exponential distribution

Description

exp_icdf simulates values from the inverse CDF of the exponential distribution.

Usage

exp_icdf(n, theta)

Arguments

n

Number of output exponential values

theta

Scale parameter \theta

Details

This function uses the exponential distribution of the form

f(t)=\theta exp(-\theta t)

to get the inverse CDF

F^(-1)(u)=(-log(1-u))/\theta

where u is a uniform random variable. It can be implemented directly and is also called by the function exp_memsim.

Value

Output is a value or a vector of values from the exponential distribution.

Examples

simdta <- exp_icdf(n = 10, theta = 0.05)


[Package cpsurvsim version 1.2.2 Index]