
The function BEZI()
defines the zero-inflated beta distribution, a
three parameter distribution, for a
gamlss.family
object to be used in GAMLSS fitting using the function gamlss()
.
The zero-inflated beta is similar to the beta distribution but allows zeros as y values. This distribution
is an extension of the beta distribution using a parameterization of the beta law that is
indexed by mean and precision parameters (Ferrari and Cribari-Neto, 2004).
The extra parameter models the probability at zero.
The functions dBEZI
, pBEZI
, qBEZI
and rBEZI
define the density,
distribution function, quantile function and random
generation for the BEZI
parameterization of the zero-inflated beta distribution.
plotBEZI
can be used to plot the distribution. meanBEZI
calculates the expected value of the response for a fitted model.
BEZI(mu.link = "logit", sigma.link = "log", nu.link = "logit")dBEZI(x, mu = 0.5, sigma = 1, nu = 0.1, log = FALSE)
pBEZI(q, mu = 0.5, sigma = 1, nu = 0.1, lower.tail = TRUE, log.p = FALSE)
qBEZI(p, mu = 0.5, sigma = 1, nu = 0.1, lower.tail = TRUE,
log.p = FALSE)
rBEZI(n, mu = 0.5, sigma = 1, nu = 0.1)
plotBEZI(mu = .5, sigma = 1, nu = 0.1, from = 0, to = 0.999, n = 101,
...)
meanBEZI(obj)
the mu
link function with default logit
the sigma
link function with default log
the nu
link function with default logit
vector of quantiles
vector of location parameter values
vector of precision parameter values
vector of parameter values modelling the probability at zero
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
where to start plotting the distribution from
up to where to plot the distribution
a fitted BEZI
object
other graphical parameters for plotting
returns a gamlss.family
object which can be used to fit a zero-inflated beta distribution in the gamlss()
function.
The zero-inflated beta distribution is given as
Here
Ferrari, S.L.P., Cribari-Neto, F. (2004). Beta regression for modelling rates and proportions. Journal of Applied Statistics, 31 (1), 799-815.
Ospina R. and Ferrari S. L. P. (2010) Inflated beta distributions, Statistical Papers, 23, 111-126.
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape (with discussion). Applied Statistics, 54 (3), 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 {
BEZI()# gives information about the default links for the BEZI distribution
# plotting the distribution
plotBEZI( mu =0.5 , sigma=5, nu = 0.1, from = 0, to=0.99, n = 101)
# plotting the cdf
plot(function(y) pBEZI(y, mu=.5 ,sigma=5, nu=0.1), 0, 0.999)
# plotting the inverse cdf
plot(function(y) qBEZI(y, mu=.5 ,sigma=5, nu=0.1), 0, 0.999)
# generate random numbers
dat<-rBEZI(100, mu=.5, sigma=5, nu=0.1)
# fit a model to the data. Tits a constant for mu, sigma and nu
# library(gamlss)
#mod1<-gamlss(dat~1,sigma.formula=~1, nu.formula=~1, family=BEZI)
#fitted(mod1)[1]
#summary(mod1)
#fitted(mod1,"mu")[1] #fitted mu
#fitted(mod1,"sigma")[1] #fitted sigma
#fitted(mod1,"nu")[1] #fitted nu
#meanBEZI(mod1)[1] # expected value of the response
# }
Run the code above in your browser using DataLab