R/rdb.R

Defines functions rdb

Documented in rdb

rdb <- function(n,alpha,beta,ntop,zeta=FALSE) {
   nbot <- 0+!zeta
   x    <- runif(n)
   p    <- c(0,pdb(nbot:ntop,alpha,beta,ntop,zeta))
   m    <- outer(x,p,">")
   r    <- apply(m,1,function(x){max((1:length(x))[x])}) - zeta
   r
}

Try the dbd package in your browser

Any scripts or data that you put into this service are public.

dbd documentation built on Aug. 19, 2021, 5:07 p.m.