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.
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
, with "identity" link as the default for the mu
parameter.sigma.link
, with "log" link as the default for the sigma
parameter.nu.link
, with "log" link as the default for the nu
parameter.tau.link
, with "log" link as the default for the tau
parameter.nu
parameter valuestau
parameter valueslength(n) > 1
, the length is
taken to be the number requiredSHASH()
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.SHASH
), Jones(2005), is defined as
$$f(y|\mu,\sigma\,\nu,\tau) = \frac{c}{\sqrt{2 \pi} \sigma (1+z^2)^{1/2}} e^{-r^2/2}$$where
$$r=\frac{1}{2} \left { \exp\left[ \tau \sinh^{-1}(z) \right] -\exp\left[ -\nu \sinh^{-1}(z) \right] \right}$$
and
$$c=\frac{1}{2} \left { \tau \exp\left[ \tau \sinh^{-1}(z) \right] + \nu \exp\left[ -\nu \sinh^{-1}(z) \right] \right}$$
and $z=(y-\mu)/\sigma$ for $-\infty < y < \infty$, $\mu=(-\infty,+\infty)$, $\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 $\nu<1$ heavier="" tail="" than="" the="" normal.="" parameter="" $\tau$="" determines="" right="" hand="" of="" distribution="" in="" same="" way.<="" p="">
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)= \frac{\tau}{\sigma} \frac{c}{\sqrt{2 \pi}} \frac{1}{2\,\sqrt{1+z^2}} \exp{(-\frac{r^2}{2})}$$
where
$$r= \sinh(\tau \, \arcsin(z)-\nu)$$
and
$$c= \cosh(\tau \arcsin(z)-\nu)$$
and $z=(y-\mu)/\sigma$ for $-\infty < y < \infty$, $\mu=(-\infty,+\infty)$, $\sigma>0$, $\nu=(-\infty,+\infty)$ 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|\mu,\sigma,\nu,\tau)= \frac{c}{\sigma} \frac{\tau}{\sqrt{2 \pi}}\frac{1}{\sqrt{1+z^2}}-\exp{-\frac{r^2}{2}}$$
where $z=(y-\mu)/(\sigma \tau)$, with $r$ and $c$ as for the pdf of the SHASHo
distribution,
for $-\infty < y < \infty$,
$\mu=(-\infty,+\infty)$,
$\sigma>0$,
$\nu=(-\infty,+\infty)$ and
$\tau>0$.
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
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,
gamlss.family
, JSU
, BCT
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))
Run the code above in your browser using DataLab