Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

BetaPrime

Beta prime distribution


Description

Density, distribution function, quantile function and random generation for the beta prime distribution.

Usage

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)

Arguments

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[X ≤ x] otherwise, P[X > x].

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Details

If X ~ Beta(α, β), then X/(1-X) ~ BetaPrime(α, β).

Probability density function

f(x) = ((x/σ)^(α-1) * (1 + x/σ)^(-α-β)) / (B(α,β) * σ)

Cumulative distribution function

F(x) = pbeta((x/σ)/(1+(x/σ)), α, β)

See Also

Examples

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)

extraDistr

Additional Univariate and Multivariate Distributions

v1.9.1
GPL-2
Authors
Tymoteusz Wolodzko
Initial release
2020-08-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.