BEINF {gamlss.dist}R Documentation

The beta inflated distribution for fitting a GAMLSS

Description

The function BEINF() defines the beta inflated distribution, a four parameter distribution, for a gamlss.family object to be used in GAMLSS fitting using the function gamlss(). The beta inflated is similar to the beta but allows zeros and one as y values. The two extra parameters model the probabilities at zero and one. The functions dBEINF, pBEINF, qBEINF and rBEInF define the density, distribution function, quantile function and random generation for the BEINF parameterization of the beta inflated distribution. plotBEINF can be used to plot the distribution. meanBEINF calculates the expected value of the response for a fitted model.

Usage

BEINF(mu.link = "logit", sigma.link = "logit", nu.link = "log", 
      tau.link = "log")
dBEINF(x, mu = 0.5, sigma = 0.1, nu = 0.1, tau = 0.1, 
       log = FALSE)
pBEINF(q, mu = 0.5, sigma = 0.1, nu = 0.1, tau = 0.1, 
       lower.tail = TRUE, log.p = FALSE)
qBEINF(p, mu = 0.5, sigma = 0.1, nu = 0.1, tau = 0.1, 
       lower.tail = TRUE, log.p = FALSE)
rBEINF(n, mu = 0.5, sigma = 0.1, nu = 0.1, tau = 0.1)
plotBEINF(mu = 0.5, sigma = 0.5, nu = 0.5, tau = 0.5, 
          from = 0.001, to = 0.999, n = 101, ...)
meanBEINF(obj)

Arguments

mu.link the mu link function with default logit
sigma.link the sigma link function with default logit
nu.link the nu link function with default log
tau.link the tau link function with default log
x,q vector of quantiles
mu vector of location parameter values
sigma vector of scale parameter values
nu vector of parameter values modelling the probability at zero
tau vector of parameter values modelling the probability at one
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
from where to start plotting the distribution from
to up to where to plot the distribution
obj a fitted BEINF object
... other graphical parameters for plotting

Details

The beta inflated distribution is given as

f(y)=p0

if (y=0)

f(y)=p1

if (y=1)

f(y|a,b)=(1/(Beta(a,b))) y^(a-1)(1-y)^(b-1)

otherwise

for y=(0,1), α>0 and β>0. The parametrization in the function BEINF() is mu=a/(a+b) and sigma=1/(a+b+1) for mu=(0,1) and sigma=(0,1) and nu=p0/p2, tau=p1/p2 where p2=1-p0-p1.

Value

returns a gamlss.family object which can be used to fit a beta inflated distribution in the gamlss() function. ...

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.

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.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, http://www.jstatsoft.org/v23/i07.

See Also

gamlss.family, BE

Examples

BEINF()# gives information about the default links for the normal distribution
# plotting the distribution
plotBEINF( mu =.5 , sigma=.5, nu = 0.5, tau = 0.5, from = 0, to=1, n = 101)
# plotting the cdf
plot(function(y) pBEINF(y, mu=.5 ,sigma=.5, nu = 0.5, tau = 0.5,), 0, 1)
# plotting the inverse cdf
plot(function(y) qBEINF(y, mu=.5 ,sigma=.5, nu = 0.5, tau = 0.5,), 0.01, .99)
# generate random numbers
dat <- rBEINF(1000,mu=.5,sigma=.5, nu=.5, tau=.5)
# fit a model to the data 
# library(gamlss)
#m1<-gamlss(dat~1,family=BEINF)
#meanBEINF(m1)[1]

[Package gamlss.dist version 3.1-0 Index]