ihs: The Inverse Hyperbolic Sine Distribution

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

Description

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

Usage

1
2
3
4
5
6
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 ≤ x] otherwise, P[X > x].

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( λ + Z/k)

where Z is a standard normal random variable, and a, b, λ, 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}) - λ )^2}}{√{2 π ((a-x)^2+b^2)}}

and if we reparametrize the distribution so that the parameters include the mean (μ) and the standard deviation (σ) instead of a and b, then we let

b = \frac{2 σ}{√{( e^{2 λ + k^{-2}} + e^{-2 λ + k^{-2}} + 2 ) ( e^{k^{-2}} - 1 )}}

a = μ - \frac{b}{2} (( e^{λ} - e^{-λ} ) e^{\frac{1}{2 k^2}} )

Thus if μ = 0, σ = √{\frac{e^2-1}{2}}, λ = 0, and k = 1, then Y = sinh(Z).

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 and k <= 0 are errors and return NaN.

Author(s)

Carter Davis, carterdavis@byu.edu

Source

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

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

Example output

Loading required package: maxLik
Loading required package: miscTools

Please cite the 'maxLik' package as:
Henningsen, Arne and Toomet, Ott (2011). maxLik: A package for maximum likelihood estimation in R. Computational Statistics 26(3), 443-458. DOI 10.1007/s00180-010-0217-1.

If you have questions, suggestions, or comments regarding the 'maxLik' package, please use a forum or 'tracker' at maxLik's R-Forge site:
https://r-forge.r-project.org/projects/maxlik/
[1] 0.5
[1] 0.3904346

ihs documentation built on May 2, 2019, 3:50 p.m.

Related to ihs in ihs...