Learn R Programming

PWEALL (version 1.3.0.1)

rpwe: Piecewise exponential distribution: random number generation

Description

This will generate random numbers according to the specified piecewise exponential distribution

Usage

rpwe(nr=10,rate=c(0,5,0.8),tchange=c(0,3))

Value

r

random numbers

Arguments

nr

number of random numbers to be generated

rate

piecewise constant event rate

tchange

a strictly increasing sequence of time points starting from zero at which event rate changes. The first element of tchange must be zero. rate and tchange must have the same length.

Author

Xiaodong Luo

Details

More details

References

Luo, et al. (2017)

See Also

piecewise exponential

Examples

Run this code
nr<-10
rate<-c(0.6,0.3)
tchange<-c(0,1.75)
pwer<-rpwe(nr=nr,rate=rate,tchange=tchange)
pwer

Run the code above in your browser using DataLab