dihs(x, mu = 0, sigma = SIGCONST, lambda = 0, k = 1, log = FALSE)
pihs(q, mu = 0, sigma = SIGCONST, lambda = 0, k = 1, lower.tail = TRUE,
log.p = FALSE)
qihs(p, mu = 0, sigma = SIGCONST, lambda = 0, k = 1, lower.tail = TRUE,
log.p = FALSE)
rihs(n, mu = 0, sigma = SIGCONST, lambda = 0, k = 1)
length(n) > 1
, the length
is taken to be the number required.0
.sqrt((exp(2)-1)/2)
.lambda < 0
, the distribution is skewed to the left. If lambda > 0
, the distribution is skewed to the right. If lambda = 0
, then the distribution is symmetric.dihs
gives the density,
pihs
gives the distribution function,
qihs
gives the quantile function, and
rihs
generates random deviates.
The length of the result is determined by n
for
rihs
, and is the maximum of the lengths of the
numerical arguments for the other functions.
The numerical arguments other than n
are recycled to the
length of the result. Only the first elements of the logical
arguments are used.
sigma <= 0<="" code=""> and k <= 0<="" code=""> are errors and return NaN
.=>
=>
dihs
is calculated from the definition (in `Details'). [pqr]ihs
are based on the relationship to the normal.mu
, sigma
, lambda
, or k
are not specified they assume the default values of mu = 0
, sigma
is approximately sqrt((exp(2)-1)/2)
, lambda = 0
, and k = 1
. These default values give the distribution sinh(z)
, where z
is a standard normal random variable.An inverse hyperbolic sine random variable $Y$ is defined by the transformation $$Y = a + b*sinh( \lambda + Z/k)$$ where $Z$ is a standard normal random variable, and $a$, $b$, $\lambda$, and $k$ control the mean, variance, skewness, and kurtosis respectively. Thus the inverse hyperbolic sine distribution has density $$f(x) = \frac{k e^{(-k^2/2) (log ( \frac{x-a}{b} + (\frac{(x-a)^2}{b^2} + 1)^{1/2}) - \lambda )^2}}{\sqrt{2 \pi ((a-x)^2+b^2)}}$$ and if we reparametrize the distribution so that the parameters include the mean ($\mu$) and the standard deviation ($\sigma$) instead of $a$ and $b$, then we let $$b = \frac{2 \sigma}{\sqrt{( e^{2 \lambda + k^{-2}} + e^{-2 \lambda + k^{-2}} + 2 ) ( e^{k^{-2}} - 1 )}}$$ $$a = \mu - \frac{b}{2} (( e^{\lambda} - e^{-\lambda} ) e^{\frac{1}{2 k^2}} )$$ Thus if $\mu = 0$, $\sigma = \sqrt{\frac{e^2-1}{2}}$, $\lambda = 0$, and $k = 1$, then $Y = sinh(Z)$.
dnorm
for the normal distribution and dlnorm
for the log-normal distribution, which is also a transformation of a normal random variable.require(graphics)
### This shows how default values of the IHS compare
### to a standard normal.
x = seq(-5,5,by=0.05)
plot(x, dnorm(x), type='l')
lines(x, dihs(x), col='blue')
pihs(0)
pihs(0, lambda = -0.5)
Run the code above in your browser using DataLab