BetaPrime | R Documentation |
Density, distribution function, quantile function and random generation for the beta prime distribution.
dbetapr(x, shape1, shape2, scale = 1, log = FALSE)
pbetapr(q, shape1, shape2, scale = 1, lower.tail = TRUE, log.p = FALSE)
qbetapr(p, shape1, shape2, scale = 1, lower.tail = TRUE, log.p = FALSE)
rbetapr(n, shape1, shape2, scale = 1)
x , q |
vector of quantiles. |
shape1 , shape2 |
non-negative parameters. |
scale |
positive valued scale parameter. |
log , log.p |
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are |
p |
vector of probabilities. |
n |
number of observations. If |
If X \sim \mathrm{Beta}(\alpha, \beta)
, then
\frac{X}{1-X} \sim \mathrm{BetaPrime}(\alpha, \beta)
.
Probability density function
f(x) = \frac{(x/\sigma)^{\alpha-1} (1+x/\sigma)^{-\alpha -\beta}}{\mathrm{B}(\alpha,\beta)\sigma}
Cumulative distribution function
F(x) = I_{\frac{x/\sigma}{1+x/\sigma}}(\alpha, \beta)
Beta
x <- rbetapr(1e5, 5, 3, 2)
hist(x, 350, freq = FALSE, xlim = c(0, 100))
curve(dbetapr(x, 5, 3, 2), 0, 100, col = "red", add = TRUE, n = 500)
hist(pbetapr(x, 5, 3, 2))
plot(ecdf(x), xlim = c(0, 100))
curve(pbetapr(x, 5, 3, 2), 0, 100, col = "red", add = TRUE, n = 500)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.