GB2 {gamlss.dist}R Documentation

The generalized Beta type 2 distribution for fitting a GAMLSS

Description

This function defines the generalized t distribution, a four parameter distribution. The response variable is in the range from zero to infinity. The functions dGB2, GB2, qGB2 and rGB2 define the density, distribution function, quantile function and random generation for the generalized beta type 2 distribution.

Usage

GB2(mu.link = "log", sigma.link = "identity", nu.link = "log", 
     tau.link = "log")
dGB2(y, mu = 1, sigma = 1, nu = 1, tau = 0.5, log = FALSE)
pGB2(q, mu = 1, sigma = 1, nu = 1, tau = 0.5, lower.tail = TRUE, 
     log.p = FALSE)
qGB2(p, mu = 1, sigma = 1, nu = 0, tau = 0.5, lower.tail = TRUE, 
     log.p = FALSE)
rGB2(n, mu = 1, sigma = 1, nu = 0, tau = 0.5)

Arguments

mu.link Defines the mu.link, with "identity" link as the default for the mu parameter.
sigma.link Defines the sigma.link, with "log" link as the default for the sigma parameter.
nu.link Defines the nu.link, with "log" link as the default for the nu parameter.
tau.link Defines the tau.link, with "log" link as the default for the tau parameter.
y,q vector of quantiles
mu vector of location parameter values
sigma vector of scale parameter values
nu vector of skewness nu parameter values
tau vector of kurtosis tau 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 probability density function of the Generalized Beta type 2, (GB2), is defined as

f(y|mu,sigma,nu,tau)=abs(sigma)*y^{sigma*nu-1}(mu^(sigma*nu)*Beta(nu,tau)(1+(y/mu)^sigma)^(nu+tau))^-1

where y>0, mu>0, -Inf<sigma<Inf, nu>0 and tau>0. .

Value

GB2() returns a gamlss.family object which can be used to fit the GB2 distribution in the gamlss() function. dGB2() gives the density, pGB2() gives the distribution function, qGB2() gives the quantile function, and rGB2() generates random deviates.

Warning

The qSHASH and rSHASH are slow since they are relying on golden section for finding the quantiles

Author(s)

Bob Rigby r.rigby@londonmet.ac.uk and Mikis Stasinopoulos d.stasinopoulos@londonmet.ac.uk

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, gamlss.family, JSU, BCT

Examples

GB2()   # 
y<- rGB2(200, mu=5, sigma=2, nu=1, tau=1)
library(MASS)
truehist(y)
fx<-dGB2(y=seq(0.01, 20, length=200), mu=5 ,sigma=2, nu=1, tau=1)
lines(seq(0.01,20,length=200),fx)
# something funny here
histDist(y, family=GB2, n.cyc=60)
integrate(function(x) x*dGB2(y=x, mu=5, sigma=2, nu=1, tau=1), 0, Inf)
mean(y)
curve(dGB2(y=x, mu=5 ,sigma=2, nu=1, tau=1), 0.01, 20, main = "The GB2  density mu=5, sigma=2, nu=1, tau=4")

[Package gamlss.dist version 1.9-0 Index]