powered by
Density, distribution function, quantile function, and random generation for the beta distribution reparameterised in terms of mean and concentration.
dbeta(x, shape1, shape2, log = FALSE, eps = 0)dbeta2(x, mu, phi, log = FALSE, eps = 0)pbeta2(q, mu, phi, lower.tail = TRUE, log.p = FALSE)qbeta2(p, mu, phi, lower.tail = TRUE, log.p = FALSE)rbeta2(n, mu, phi)
dbeta2(x, mu, phi, log = FALSE, eps = 0)
pbeta2(q, mu, phi, lower.tail = TRUE, log.p = FALSE)
qbeta2(p, mu, phi, lower.tail = TRUE, log.p = FALSE)
rbeta2(n, mu, phi)
dbeta2 gives the density, pbeta2 gives the distribution function, qbeta2 gives the quantile function, and rbeta2 generates random deviates.
dbeta2
pbeta2
qbeta2
rbeta2
vector of quantiles
non-negative parameters
logical; if TRUE, probabilities/ densities \(p\) are returned as \(\log(p)\).
TRUE
for internal use only, don't change.
mean parameter, must be in the interval from 0 to 1.
concentration parameter, must be positive.
logical; if TRUE (default), probabilities are \(P[X \le x]\), otherwise \(P[X > x]\).
vector of probabilities
number of random values to return.
This implementation allows for automatic differentiation with RTMB.
RTMB
Currently, dbeta masks RTMB::dbeta because the latter has a numerically unstable gradient.
dbeta
RTMB::dbeta
set.seed(123) x <- rbeta2(1, 0.5, 1) d <- dbeta2(x, 0.5, 1) p <- pbeta2(x, 0.5, 1) q <- qbeta2(p, 0.5, 1)
Run the code above in your browser using DataLab