Description Usage Arguments Details Value Note Author(s) References See Also Examples
The function BEOI()
defines the one-inflated beta distribution, a
three parameter distribution, for a
gamlss.family
object to be used in GAMLSS fitting using the function gamlss()
.
The one-inflated beta is similar to the beta distribution but allows ones 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 one.
The functions dBEOI
, pBEOI
, qBEOI
and rBEOI
define the density,
distribution function, quantile function and random
generation for the BEOI
parameterization of the one-inflated beta distribution.
plotBEOI
can be used to plot the distribution. meanBEOI
calculates the expected value of
the response for a fitted model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | BEOI(mu.link = "logit", sigma.link = "log", nu.link = "logit")
dBEOI(x, mu = 0.5, sigma = 1, nu = 0.1, log = FALSE)
pBEOI(q, mu = 0.5, sigma = 1, nu = 0.1, lower.tail = TRUE, log.p = FALSE)
qBEOI(p, mu = 0.5, sigma = 1, nu = 0.1, lower.tail = TRUE,
log.p = FALSE)
rBEOI(n, mu = 0.5, sigma = 1, nu = 0.1)
plotBEOI(mu = .5, sigma = 1, nu = 0.1, from = 0.001, to = 1, n = 101,
...)
meanBEOI(obj)
|
mu.link |
the |
sigma.link |
the |
nu.link |
the |
x,q |
vector of quantiles |
mu |
vector of location parameter values |
sigma |
vector of precision parameter values |
nu |
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 |
from |
where to start plotting the distribution from |
to |
up to where to plot the distribution |
obj |
a fitted |
... |
other graphical parameters for plotting |
The one-inflated beta distribution is given as
f(y)=nu
if (y=1)
f(y|mu,sigma)=(1-nu)*(Gamma(sigma)/Gamma(mu*sigma)*Gamma((1-mu)*sigma))*y^(mu*sigma-1)*(1-y)^(((1-mu)*sigma)-1)
if y=(0,1). The parameters satisfy 0<mu<1, sigma>0 and 0<nu<1.
Here E(y)=nu+(1-nu)*mu and Var(y)=(1-nu)*(mu*(1-mu))/(sigma+1) + nu*(1-nu)*(1-mu)^2.
returns a gamlss.family
object which can be used to fit a one-inflated beta distribution in the gamlss()
function.
This work is part of my PhD project at the University of Sao Paulo under the supervion of Professor Silvia Ferrari. My thesis is concerned with regression modelling of rates and proportions with excess of zeros and/or ones
Raydonal Ospina, Department of Statistics, University of Sao Paulo, Brazil.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | BEOI()# gives information about the default links for the BEOI distribution
# plotting the distribution
plotBEOI( mu =0.5 , sigma=5, nu = 0.1, from = 0.001, to=1, n = 101)
# plotting the cdf
plot(function(y) pBEOI(y, mu=.5 ,sigma=5, nu=0.1), 0.001, 0.999)
# plotting the inverse cdf
plot(function(y) qBEOI(y, mu=.5 ,sigma=5, nu=0.1), 0.001, 0.999)
# generate random numbers
dat<-rBEOI(100, mu=.5, sigma=5, nu=0.1)
# fit a model to the data.
# library(gamlss)
#mod1<-gamlss(dat~1,sigma.formula=~1, nu.formula=~1, family=BEOI)
#fitted(mod1)[1]
#summary(mod1)
#fitted(mod1,"mu")[1] #fitted mu
#fitted(mod1,"sigma")[1] #fitted sigma
#fitted(mod1,"nu")[1] #fitted nu
#meanBEOI(mod1)[1] # expected value of the response
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.