dBeta function

Probability density function of the beta distribution

Probability density function of the beta distribution

The function computes the probability density function of the beta distribution with a mean-precision parameterization. It can also compute the probability density function of the augmented beta distribution by assigning positive probabilities to zero and/or one values and a (continuous) beta density to the interval (0,1).

dBeta(x, mu, phi, q0 = NULL, q1 = NULL)

Arguments

  • x: a vector of quantiles.
  • mu: the mean parameter. It must lie in (0, 1).
  • phi: the precision parameter. It must be a real positive value.
  • q0: the probability of augmentation in zero. It must lie in (0, 1). In case of no augmentation, it is NULL (default).
  • q1: the probability of augmentation in one. It must lie in (0, 1). In case of no augmentation, it is NULL (default).

Returns

A vector with the same length as x.

Details

The beta distribution has density

fB(x;μ,ϕ)=Γ(ϕ)Γ(μϕ)Γ((1μ)ϕ)xμϕ1(1x)(1μ)ϕ1 f_B(x;\mu,\phi)=\frac{\Gamma{(\phi)}}{\Gamma{(\mu\phi)}\Gamma{((1-\mu)\phi)}}x^{\mu\phi-1}(1-x)^{(1-\mu)\phi-1}

for 0<x<10<x<1, where 0<μ<10<\mu<1 identifies the mean and ϕ>0\phi>0 is the precision parameter.

The augmented beta distribution has density

  • q0q_0, if x=0x=0
  • q1q_1, if x=1x=1
  • (1q0q1)fB(x;μ,ϕ)(1-q_0-q_1)f_B(x;\mu,\phi), if 0\<x\<10\<x\<1

where 0<q0<10<q_0<1 identifies the augmentation in zero, 0<q1<10<q_1<1 identifies the augmentation in one, and q0+q1<1q_0+q_1<1.

Examples

dBeta(x = c(.5,.7,.8), mu = .3, phi = 20) dBeta(x = c(.5,.7,.8), mu = .3, phi = 20, q0 = .2) dBeta(x = c(.5,.7,.8), mu = .3, phi = 20, q0 = .2, q1= .1)

References

Ferrari, S.L.P., Cribari-Neto, F. (2004). Beta Regression for Modeling Rates and Proportions. Journal of Applied Statistics, 31 (7), 799--815. doi:10.1080/0266476042000214501

  • Maintainer: Roberto Ascari
  • License: GPL (>= 2)
  • Last published: 2023-09-29

Useful links