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. BE()
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.
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)
the mu
link function with default logit
the sigma
link function with default logit
vector of quantiles
vector of location parameter values
vector of scale parameter values
logical; if TRUE, probabilities p are given as log(p).
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]
vector of probabilities.
number of observations. If length(n) > 1
, the length is
taken to be the number required
returns a gamlss.family
object which can be used to fit a normal distribution in the gamlss()
function.
The original beta distributions distribution is given as
gamlss
implementation of BEo
BE()
is
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.
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 http://www.gamlss.org/).
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, http://www.jstatsoft.org/v23/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.
# NOT RUN {
BE()# gives information about the default links for the normal 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]
# }
Run the code above in your browser using DataLab