expgen: expgen

Description Usage Arguments Value Examples

Description

This function returns a positive number following exponential distribution. Using the inverse transform method, it can be proven that if variable x in the interval of (0,1) follows uniform distribution , -1/λ *lnx follows exponential distribution with parameter λ. So it simply uses cugen to generate a number between 0 and 1, and returns 1/ λ * logarithm of that number.

Usage

1
expgen(x)

Arguments

'λ' (the exponential distribution's parameter) is the function's argument,

Value

Returns a positive number following exponential distribution

Examples

1
2
3
a <- expgen(250)
a
visualexpgen(a)

Esra-K/Stats documentation built on May 29, 2019, 6:41 a.m.