The Sinh-Arcsinh (SHASH) distribution is 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.

There are 3 different SHASH distributions implemented in GAMLSS.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | ```
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)
SHASHo(mu.link = "identity", sigma.link = "log", nu.link = "identity",
tau.link = "log")
dSHASHo(x, mu = 0, sigma = 1, nu = 0, tau = 1, log = FALSE)
pSHASHo(q, mu = 0, sigma = 1, nu = 0, tau = 1, lower.tail = TRUE,
log.p = FALSE)
qSHASHo(p, mu = 0, sigma = 1, nu = 0, tau = 1, lower.tail = TRUE,
log.p = FALSE)
rSHASHo(n, mu = 0, sigma = 1, nu = 0, tau = 1)
SHASHo2(mu.link = "identity", sigma.link = "log", nu.link = "identity",
tau.link = "log")
dSHASHo2(x, mu = 0, sigma = 1, nu = 0, tau = 1, log = FALSE)
pSHASHo2(q, mu = 0, sigma = 1, nu = 0, tau = 1, lower.tail = TRUE,
log.p = FALSE)
qSHASHo2(p, mu = 0, sigma = 1, nu = 0, tau = 1, lower.tail = TRUE,
log.p = FALSE)
rSHASHo2(n, mu = 0, sigma = 1, nu = 0, tau = 1)
``` |

`mu.link` |
Defines the |

`sigma.link` |
Defines the |

`nu.link` |
Defines the |

`tau.link` |
Defines the |

`x,q` |
vector of quantiles |

`mu` |
vector of location parameter values |

`sigma` |
vector of scale parameter values |

`nu` |
vector of skewness |

`tau` |
vector of kurtosis |

`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 |

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.

The second form of the Sinh-Arcsinh distribution can be found in Jones and Pewsey (2009, p.2) denoted by `SHASHo`

and the probability density function is defined as,

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

where

*r= sinh(tau*asinh(z)-nu)*

and

*c= cosh(τ asinh(z)-ν)*

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

The third form of the Sinh-Arcsinh distribution (Jones and Pewsey, 2009, p.8) divides the distribution by sigma for the density of the unstandardized variable. This distribution is denoted by `SHASHo2`

and has pdf

*f(y|μ,σ,ν,τ)= (c/sigma)*(tau/((2 π)^(1/2)))*(1/((1+z^2)^(1/2)))-exp(-r^2*0.5)*

where *z=(y-mu)/(sigma*tau)*, with *r* and *c* as for the pdf of the `SHASHo`

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

`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.

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

Bob Rigby, Mikis Stasinopoulos mikis.stasinopoulos@gamlss.org and Fiona McElduff

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

Jones and Pewsey (2009) Sinh-arcsinh distributions. *Biometrika.* **96**(4), pp. 761?780.

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.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.

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))
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.