Learn R Programming

extrafrail (version 1.12)

rWL: Generated random variables from the weighted Lindley distribution.

Description

Generated random variables from the weighted Lindley distribution with mean 1.

Usage

rWL(n, theta = 1)

Value

a vector of length n with the generated values.

Arguments

n

number of observations. If length(n) > 1, the length is taken to be the number required.

theta

variance of the variable.

Author

Diego Gallardo and Marcelo Bourguignon.

Details

The weighted Lindley distribution has probability density function $$ f(z;\theta)=\frac{\theta}{2\Gamma(\theta)}a_{\theta}^{-b_{\theta}-1}z^{b_{\theta}-1}(1+z)\exp\left(-\frac{z}{a_{\theta}}\right), \quad z, \theta>0, $$ where \(a_{\theta}=\frac{\theta(\theta+4)}{2(\theta+2)}\) and \(b_{\theta}=\frac{4}{\theta(\theta+4)}\). Under this parametrization, E(Z)=1 and Var(Z)=\(\theta\).

References

Gallardo, D.I., Bourguignon, M. (2022) The multivariate weighted Lindley frailty model for cluster failure time data. Submitted.

Examples

Run this code
rWL(10, theta=0.5)

Run the code above in your browser using DataLab