BE: The beta distribution for fitting a GAMLSS

BER Documentation

The beta distribution for fitting a GAMLSS

Description

The functions BE() and BEo() define the beta distribution, a two parameter distribution, for a gamlss.family object to be used in GAMLSS fitting using the function gamlss(). BE() has mean equal to the parameter mu and sigma as scale parameter, see below. BEo() is the original parameterizations of the beta distribution as in dbeta() with shape1=mu and shape2=sigma. The functions dBE and dBEo, pBE and pBEo, qBE and qBEo and finally rBE and rBE define the density, distribution function, quantile function and random generation for the BE and BEo parameterizations respectively of the beta distribution.

Usage

BE(mu.link = "logit", sigma.link = "logit")
dBE(x, mu = 0.5, sigma = 0.2, log = FALSE)
pBE(q, mu = 0.5, sigma = 0.2, lower.tail = TRUE, log.p = FALSE)
qBE(p, mu = 0.5, sigma = 0.2, lower.tail = TRUE, log.p = FALSE)
rBE(n, mu = 0.5, sigma = 0.2)
BEo(mu.link = "log", sigma.link = "log")
dBEo(x, mu = 0.5, sigma = 0.2, log = FALSE)
pBEo(q, mu = 0.5, sigma = 0.2, lower.tail = TRUE, log.p = FALSE)
qBEo(p, mu = 0.5, sigma = 0.2, lower.tail = TRUE, log.p = FALSE)

Arguments

mu.link

the mu link function with default logit

sigma.link

the sigma link function with default logit

x,q

vector of quantiles

mu

vector of location parameter values

sigma

vector of scale parameter values

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

The standard parametrization of the beta distribution is given as:

f(y|\alpha,\beta)=\frac{1}{B(\alpha, \beta)} y^{\alpha-1}(1-y)^{\beta-1}

for y=(0,1), \alpha>0 and \beta>0.

The first gamlss implementation the beta distribution is called BEo, and it is identical to the standard parametrization with \alpha=\mu and \beta = \sigma, see pp. 460-461 of Rigby et al. (2019):

f(y|\mu,\sigma)=\frac{1}{B(\mu, \sigma)} y^{\mu-1}(1-y)^{\sigma-1}

for y=(0,1), \mu>0 and \sigma>0. The problem with this parametrization is that with mean E(y)=\mu/(\mu+\sigma) it is not convenient for modelling the response y as function of the explanatory variables. The second parametrization, BE see pp. 461-463 of Rigby et al. (2019), is using

\mu=\frac{\alpha}{\alpha+\beta}

\sigma= \frac{1}{\alpha+\beta+1)^{1/2}}

(of the standard parametrization) and it is more convenient because \mu now is the mean with variance equal to Var(y)=\sigma^2 \mu (1-\mu). Note however that 0<\mu<1 and 0<\sigma<1.

Value

BE() and BEo() return a gamlss.family object which can be used to fit a beta distribution in the gamlss() function.

Note

Note that for BE, mu is the mean and sigma a scale parameter contributing to the variance of y

Author(s)

Bob Rigby and Mikis Stasinopoulos

References

Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554.

Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1201/9780429298547")}. An older version can be found in https://www.gamlss.com/.

Stasinopoulos D. M., Rigby R.A. and Akantziliotou C. (2006) Instructions on how to use the GAMLSS package in R. Accompanying documentation in the current GAMLSS help files, (see also https://www.gamlss.com/).

Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v023.i07")}.

Stasinopoulos D. M., Rigby R.A., Heller G., Voudouris V., and De Bastiani F., (2017) Flexible Regression and Smoothing: Using GAMLSS in R, Chapman and Hall/CRC. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1201/b21973")}

(see also https://www.gamlss.com/).

See Also

gamlss.family, BE, LOGITNO, GB1, BEINF

Examples

BE()# gives information about the default links for the beta distribution
dat1<-rBE(100, mu=.3, sigma=.5)
hist(dat1)        
#library(gamlss)
# mod1<-gamlss(dat1~1,family=BE) # fits a constant for mu and sigma 
#fitted(mod1)[1]
#fitted(mod1,"sigma")[1]
plot(function(y) dBE(y, mu=.1 ,sigma=.5), 0.001, .999)
plot(function(y) pBE(y, mu=.1 ,sigma=.5), 0.001, 0.999)
plot(function(y) qBE(y, mu=.1 ,sigma=.5), 0.001, 0.999)
plot(function(y) qBE(y, mu=.1 ,sigma=.5, lower.tail=FALSE), 0.001, .999)
dat2<-rBEo(100, mu=1, sigma=2)
#mod2<-gamlss(dat2~1,family=BEo) # fits a constant for mu and sigma 
#fitted(mod2)[1]
#fitted(mod2,"sigma")[1]

gamlss.dist documentation built on Aug. 24, 2023, 1:06 a.m.