SHASH: The Sinh-Arcsinh (SHASH) distribution for fitting a GAMLSS

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

Description

This function defines the Sinh-Arcsinh (SHASH) distribution, a four parameter distribution, for a gamlss.family object to be used for a GAMLSS fitting using the function gamlss(). The functions dSHASH, pSHASH, qSHASH and rSHASH define the density, distribution function, quantile function and random generation for the Sinh-Arcsinh (SHASH) distribution.

Usage

1
2
3
4
5
6
7
8
SHASH(mu.link = "identity", sigma.link = "log", nu.link = "log", 
      tau.link = "log")
dSHASH(x, mu = 0, sigma = 1, nu = 0.5, tau = 0.5, log = FALSE)
pSHASH(q, mu = 0, sigma = 1, nu = 0.5, tau = 0.5, lower.tail = TRUE, 
     log.p = FALSE)
qSHASH(p, mu = 0, sigma = 1, nu = 0.5, tau = 0.5, lower.tail = TRUE, 
     log.p = FALSE)
rSHASH(n, mu = 0, sigma = 1, nu = 0.5, 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.

x,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 Sinh-Arcsinh distribution, (SHASH), Jones(2005), is defined as

f(y|mu,sigma,nu,tau)=c/(sqrt(2*pi)*sigma*(1+z^2)^(1/2)) exp(-(r^2)/2)

where

r=0.5*[exp(tau*sinh^(-1)(z))-exp(-nu*sinh^(-1)(z))]

and

c=0.5*[rho*exp(tau*sinh^(-1)(z))+ nu * exp(-nu*sinh^(-1)(z))]

and z=(y-mu)/sigma for 0<y<0, mu=(-Inf,+Inf), sigma>0, nu>0 and tau>0.

The parameters mu and sigma are the location and scale of the distribution. The parameter nu determines the left hand tail of the distribution with nu>1 indicating a lighter tail than the normal and ν<1 heavier tail than the normal. The parameter tau determines the right hand tail of the distribution in the same way.

Value

SHASH() returns a gamlss.family object which can be used to fit the SHASH distribution in the gamlss() function. dSHASH() gives the density, pSHASH() gives the distribution function, qSHASH() gives the quantile function, and rSHASH() 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

Jones, M. C. (2006) p 546-547 in the discussion of Rigby, R. A. and Stasinopoulos D. M. (2005) Appl. Statist., 54, part 3.

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, JSU, BCT

Examples

1
2
3
4
5
6
7
8
9
SHASH()   # 
plot(function(x)dSHASH(x, mu=0,sigma=1, nu=1, tau=2), -5, 5, 
 main = "The SHASH  density mu=0,sigma=1,nu=1, tau=2")
plot(function(x) pSHASH(x, mu=0,sigma=1,nu=1, tau=2), -5, 5, 
 main = "The BCPE  cdf mu=0, sigma=1, nu=1, tau=2")
dat<-rSHASH(100,mu=10,sigma=1,nu=1,tau=1.5)
hist(dat)
# library(gamlss)
# gamlss(dat~1,family=SHASH, control=gamlss.control(n.cyc=30))

Example output

Loading required package: MASS

GAMLSS Family: SHASH Sinh-Arcsinh 
Link function for mu   : identity 
Link function for sigma: log 
Link function for nu   : log 
Link function for tau  : log 

gamlss.dist documentation built on May 2, 2019, 5:20 p.m.