weib_icdf: Inverse CDF value generation for the Weibull distribution

View source: R/weibullfns.R

weib_icdfR Documentation

Inverse CDF value generation for the Weibull distribution

Description

weib_icdf returns a value from the Weibull distribution by using the inverse CDF.

Usage

weib_icdf(n, gamma, theta)

Arguments

n

Number of output Weibull values

gamma

Shape parameter \gamma

theta

Scale parameter \theta

Details

This function uses the Weibull density of the form

f(t)=\theta t^(\gamma - 1)exp(-\theta/\gamma t^(\gamma))

to get the inverse CDF

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

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

Value

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

Examples

simdta <- weib_icdf(n = 10, theta = 0.05, gamma = 2)


cpsurvsim documentation built on Sept. 8, 2023, 5:35 p.m.