EGB function

The Exponential Generalized Beta of the Second Type Distribution

The Exponential Generalized Beta of the Second Type Distribution

Density, distribution function, quantile function and random generation for exponential generalized beta of the second type distribution.

dEGB(y_star, mu, phi, log = FALSE) pEGB(q, mu, phi) qEGB(p, mu, phi) rEGB(n, mu, phi)

Arguments

  • y_star, q: vector of quantiles.
  • mu: mu parameter.
  • phi: phi parameter.
  • log: logical; if TRUE, probabilities p are given as log(p). Default is FALSE.
  • p: vector of probabilities.
  • n: number of observations. If length(n) > 1, the length is taken to be the number required.

Returns

dEGB gives the density, pEGB gives the distribution function, qEGB gives the quantile function, and rEGB generates random variables.

Details

The EGB distribution with parameters mu =μ\mu and phi =ϕ\phi has density

f(y;μ,ϕ)=B1(μϕ,(1μ)ϕ)exp{y(1μ)ϕ}/(1+exp{y})ϕ, f(y^\star;\mu,\phi)=B^{-1}(\mu\phi,(1-\mu)\phi) \exp\{-y^\star(1-\mu)\phi\}/ (1+\exp\{-y^\star\})^{\phi},

with μ(0,1),ϕ>0\mu\in(0,1),\phi>0 and y(,)y^\star \in (-\infty, \infty). For this distribution, E(y)=ψ(μϕ)ψ((1μ)ϕ)E(y^\star)=\psi(\mu\phi)-\psi((1-\mu)\phi) and Var(y)=ψ(μϕ)+ψ((1μ)ϕ)Var(y^\star)=\psi'(\mu\phi)+\psi'((1-\mu)\phi), where ψ\psi

is the digamma function. See Kerman and McDonald (2015) for additional details. If ybeta(μ,ϕ)y \sim beta(\mu, \phi), with μ\mu and ϕ\phi representing the mean and precision of yy, then y=log(y/(1y))EGB(μ,ϕ)y^\star = \log(y/(1-y)) \sim EGB(\mu, \phi) with the density given above.

Examples

dEGB(0.2, mu = 0.3, phi = 1) mu = 0.2; phi = 2; set.seed(1) EGBsample = rEGB(1000, mu, phi) hist(EGBsample, prob = TRUE, breaks = 15, main = "", las = 1, ylim = c(0, 0.2), xlim = c(-20, 10)) curve(dEGB(x, mu, phi), from = -20, to = 8, add = TRUE, col = "red") # Showing the P(Y* < -5) = 0.17, where Y* ~ EGB(0.2, 2). x = seq(-20, 10,0.01) y = dEGB(x, mu, phi) plot(x, y, type = "l", lwd = 2, las = 1) x1 = seq(-20, -5, 0.01) y1 = dEGB(x1, mu, phi) polygon(c(x1, -5, -5), c(y1, 0, 0), col = "lightblue") plot(x, pEGB(x, mu, phi), type = "l", las = 1, lwd = 2, ylab = expression(P("Y*"<y)), xlab = "y") p = pEGB(0, mu, phi) q = qEGB(p, mu, phi) points(q, p, pch = 16, col = 2, cex = 1.5) text(2, 0.83, paste("(", 0, ",", round(p, 2), ")"), font = 2, cex = 0.8, col = "red")

References

Maluf, Y.S., Ferrari, S.L.P., and Queiroz, F.F. (2022). Robust beta regression through the logit transformation. arXiv:2209.11315.

Kerman, S. and McDonald, J.B. (2015). Skewness-kurtosis bounds for EGB1, EGB2, and special cases. Communications in Statistics - Theory and Methods, 44:3857-3864.

Author(s)

Yuri S. Maluf (yurimaluf@gmail.com ), Francisco F. Queiroz (ffelipeq@outlook.com ) and Silvia L. P. Ferrari.

  • Maintainer: Felipe Queiroz
  • License: GPL-3
  • Last published: 2022-10-28

Useful links