Learn R Programming

ihs (version 1.0)

ihs: The Inverse Hyperbolic Sine Distribution

Description

Density, distribution function, quantile function and random generation for the inverse hyperbolic sine distribution.

Usage

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)

Arguments

x, q
vector of quantiles.
p
vector of probabilities.
n
number of observations. If length(n) > 1, the length is taken to be the number required.
mu
vector of means. The default value is 0.
sigma
vector of standard deviations. The default value is sqrt((exp(2)-1)/2).
lambda
vector of skewness parameters. If 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.
k
vector of parameters. This parameter controls the skewness of the distribution.
log, log.p
logical; if TRUE, probabilities p are given as log(p).
lower.tail
logical; if TRUE (default), probabilities are $P[X \le x]$ otherwise, $P[X > x]$.

Value

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

source

dihs is calculated from the definition (in `Details'). [pqr]ihs are based on the relationship to the normal.

Details

If 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)$.

References

Hansen, C., McDonald, J. B., and Theodossiou, P. (2007) "Some Flexible Parametric Models for Partially Adaptive Estimators of Econometric Models" Economics - The Open-Access, Open-Assessment E-Journal, volume 1, 1-20. Hansen, C., McDonald, J. B., and Newey, W. K. (2010) "Instrumental Variables Regression with Flexible Distributions" Journal of Business and Economic Statistics, volume 28, 13-25.

See Also

Distributions for other standard distributions such as dnorm for the normal distribution and dlnorm for the log-normal distribution, which is also a transformation of a normal random variable.

Examples

Run this code
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