rpwu | R Documentation |
This will generate random numbers according to the specified piecewise uniform distribution
rpwu(nr=10,u=c(0,6,0.4),ut=c(1,2))
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. |
Let f(t)=\sum_{j=1}^m u_j I(t_{j-1}<t\le t_j)
be the density function, where u_1,\ldots,u_m
are the corresponding elements of u and t_1,\ldots,t_{m}
are the corresponding elements of ut and t_0=0
.
The distribution function
F(t)=\sum_{j=1}^m u_j(t\wedge t_j-t\wedge t_{j-1}).
User must make sure that \sum_{j=1}^m u_j (t_j-t_{j-1})=1
before using this function.
r |
random numbers |
This provides a random number generator of the piecewise uniform distribution
Xiaodong Luo
Luo, et al. (2017)
rpwe
nr<-10
u<-c(0.6,0.4)
ut<-c(1,2)
pwur<-rpwu(nr=nr,u=u,ut=ut)
pwur
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.