rpwu {PWEALL} | R Documentation |
Piecewise uniform distribution: random number generation
Description
This will generate random numbers according to the specified piecewise uniform distribution
Usage
rpwu(nr=10,u=c(0,6,0.4),ut=c(1,2))
Arguments
nr |
number of random numbers to be generated |
u |
piecewise constant density |
ut |
a strictly increasing sequence of time points defining the pieces. The first element must be strictly greater than zero. |
Details
Let be the density function, where
are the corresponding elements of u and
are the corresponding elements of ut and
.
The distribution function
User must make sure that before using this function.
Value
r |
random numbers |
Note
This provides a random number generator of the piecewise uniform distribution
Author(s)
Xiaodong Luo
References
Luo, et al. (2017)
See Also
Examples
nr<-10
u<-c(0.6,0.4)
ut<-c(1,2)
pwur<-rpwu(nr=nr,u=u,ut=ut)
pwur
[Package PWEALL version 1.3.0.1 Index]