BCt: Box-Cox t distribution for fitting a GAMLSS

Description Usage Arguments Details Value Warning Note Author(s) References See Also Examples

Description

The function BCT() defines the Box-Cox t distribution, a four parameter distribution, for a gamlss.family object to be used in GAMLSS fitting using the function gamlss(). The functions dBCT, pBCT, qBCT and rBCT define the density, distribution function, quantile function and random generation for the Box-Cox t distribution. [The function BCTuntr() is the original version of the function suitable only for the untruncated BCT distribution]. See Rigby and Stasinopoulos (2003) for details. The function BCT is identical to BCT but with log link for mu.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
BCT(mu.link = "identity", sigma.link = "log", nu.link = "identity", 
          tau.link = "log")
BCTo(mu.link = "log", sigma.link = "log", nu.link = "identity", 
          tau.link = "log")
BCTuntr(mu.link = "identity", sigma.link = "log", nu.link = "identity", 
          tau.link = "log")
dBCT(x, mu = 5, sigma = 0.1, nu = 1, tau = 2, log = FALSE)
pBCT(q, mu = 5, sigma = 0.1, nu = 1, tau = 2, lower.tail = TRUE, log.p = FALSE)
qBCT(p, mu = 5, sigma = 0.1, nu = 1, tau = 2, lower.tail = TRUE, log.p = FALSE)          
rBCT(n, mu = 5, sigma = 0.1, nu = 1, tau = 2)
dBCTo(x, mu = 5, sigma = 0.1, nu = 1, tau = 2, log = FALSE)
pBCTo(q, mu = 5, sigma = 0.1, nu = 1, tau = 2, lower.tail = TRUE, log.p = FALSE)
qBCTo(p, mu = 5, sigma = 0.1, nu = 1, tau = 2, lower.tail = TRUE, log.p = FALSE)          
rBCTo(n, mu = 5, sigma = 0.1, nu = 1, tau = 2)

Arguments

mu.link

Defines the mu.link, with "identity" link as the default for the mu parameter. Other links are "inverse", "log" and "own"

sigma.link

Defines the sigma.link, with "log" link as the default for the sigma parameter. Other links are "inverse","identity", "own"

nu.link

Defines the nu.link, with "identity" link as the default for the nu parameter. Other links are "inverse", "log", "own"

tau.link

Defines the tau.link, with "log" link as the default for the tau parameter. Other links are "inverse", "identity" and "own"

x,q

vector of quantiles

mu

vector of location parameter values

sigma

vector of scale parameter values

nu

vector of nu parameter values

tau

vector of 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 untruncated Box-Cox t distribution, BCTuntr, is given by

f(y|mu,sigma,nu,tau)=(1/(y*sigma))*(Γ((tau+1)/2)/(Gamma(1/2)*Gamma(tau/2)*tau^0.5))*(1+z^2/tau)^(-(tau+1)/2)

where if ν!=0 then z=[(y/mu)^(nu)-1]/(nu*sigma) else z=log(y/μ)/σ, for y>0, μ>0, σ>0, ν=(-Inf,+Inf) and τ>0.

The Box-Cox t distribution, BCT, adjusts the above density f(y|mu,sigma,nu,tau for the truncation resulting from the condition y>0. See Rigby and Stasinopoulos (2003) for details.

Value

BCT() returns a gamlss.family object which can be used to fit a Box Cox-t distribution in the gamlss() function. dBCT() gives the density, pBCT() gives the distribution function, qBCT() gives the quantile function, and rBCT() generates random deviates.

Warning

The use BCTuntr distribution may be unsuitable for some combinations of the parameters (mainly for large sigma) where the integrating constant is less than 0.99. A warning will be given if this is the case.

The BCT distribution is suitable for all combinations of the parameters within their ranges [i.e. mu>0, sigma>0, nu=(-Inf,+Inf) and tau>0 ]

Note

mu is the median of the distribution, sigma*(tau/(tau-2))^0.5 is approximate the coefficient of variation (for small sigma and moderate nu>0 and moderate or large tau), nu controls the skewness and tau the kurtosis of the distribution

Author(s)

Mikis Stasinopoulos, Bob Rigby and Calliope Akantziliotou

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.

Rigby, R.A. Stasinopoulos, D.M. (2006). Using the Box-Cox t distribution in GAMLSS to mode skewnees and and kurtosis. to appear in Statistical Modelling.

Rigby, R. A., Stasinopoulos, D. M., Heller, G. Z., and De Bastiani, F. (2019) Distributions for modeling location, scale, and shape: Using GAMLSS in R, Chapman and Hall/CRC. An older version can be found in 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.

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.

See Also

gamlss.family, BCPE, BCCG

Examples

1
2
3
4
5
6
7
8
9
BCT()   # gives information about the default links for the Box Cox t distribution
# library(gamlss)
#data(abdom)
#h<-gamlss(y~cs(x,df=3), sigma.formula=~cs(x,1), family=BCT, data=abdom) # 
#plot(h)
plot(function(x)dBCT(x, mu=5,sigma=.5,nu=1, tau=2), 0.0, 20, 
 main = "The BCT  density mu=5,sigma=.5,nu=1, tau=2")
plot(function(x) pBCT(x, mu=5,sigma=.5,nu=1, tau=2), 0.0, 20, 
 main = "The BCT  cdf mu=5, sigma=.5, nu=1, tau=2")

Example output

Loading required package: MASS

GAMLSS Family: BCT Box-Cox t 
Link function for mu   : identity 
Link function for sigma: log 
Link function for nu   : identity 
Link function for tau  : log 

gamlss.dist documentation built on July 13, 2020, 5:08 p.m.