https://github.com/cran/rstpm2
Tip revision: 45536c5580212aeb43a1cdf1a690e92cc843203c authored by Mark Clements on 07 January 2023, 02:40:02 UTC
version 1.5.9
version 1.5.9
Tip revision: 45536c5
random.R
## Drop-in replacement functions (not exported)
rgompertz = function(n, shape, rate) {
u <- 1-runif(n)
i <- shape >= 0 | u>=exp(rate/shape)
y <- rep(Inf, n)
if (any(i))
y[i] <- log(1 - shape*log(u[i])/rate) / shape
y
}
rllogis = function(n, shape, scale) {
u <- runif(n)
scale*(u/(1-u))^(1/shape)
}