R/rPT.R

Defines functions rPT

Documented in rPT

rPT <- function(n, mu, D, a, max=10*sqrt(mu*D), tol=1e-4)
 {
   dd <- cumsum(dPT(0:max, mu, D, a))
   if (1-max(dd) > tol)
    warning("Increase 'max' argument to obtain better simulated data")
   prob <- runif(n, 0, max(dd))

   ans <- sapply(prob, function(x, dd, max) c(0:max)[dd>=x][1], dd=dd, max=max)
   ans
 } 

Try the tweeDEseq package in your browser

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

tweeDEseq documentation built on May 2, 2018, 4:44 a.m.