BetaPrime function

Beta prime distribution

Beta prime distribution

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)

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[Xx]P[X \le x]

    otherwise, P[X>x]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(α,β)X ~ Beta(\alpha, \beta), then X/(1X) BetaPrime(α,β)X/(1-X) ~ BetaPrime(\alpha, \beta).

Probability density function

f(x)=(x/σ)α1(1+x/σ)αβB(α,β)σf(x)=((x/σ)(α1)(1+x/σ)(αβ))/(B(α,β)σ) f(x) = \frac{(x/\sigma)^{\alpha-1} (1+x/\sigma)^{-\alpha -\beta}}{\mathrm{B}(\alpha,\beta)\sigma}f(x) = ((x/\sigma)^(\alpha-1) * (1 + x/\sigma)^(-\alpha-\beta)) / (B(\alpha,\beta) * \sigma)

Cumulative distribution function

F(x)=Ix/σ1+x/σ(α,β)F(x)=pbeta((x/σ)/(1+(x/σ)),α,β) F(x) = I_{\frac{x/\sigma}{1+x/\sigma}}(\alpha, \beta)F(x) = pbeta((x/\sigma)/(1+(x/\sigma)), \alpha, \beta)

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)

See Also

Beta

  • Maintainer: Tymoteusz Wolodzko
  • License: GPL-2
  • Last published: 2023-11-30