TukeyGH {TukeyGH77} | R Documentation |
Tukey g
-&-h
Distribution
Description
Density, distribution function, quantile function and simulation
for Tukey g
-&-h
distribution with
location parameter A
,
scale parameter B
,
skewness g
and
elongation h
.
Usage
dGH(x, A = 0, B = 1, g = 0, h = 0, log = FALSE, ...)
rGH(n, A = 0, B = 1, g = 0, h = 0)
qGH(p, A = 0, B = 1, g = 0, h = 0, lower.tail = TRUE, log.p = FALSE)
pGH(q, A = 0, B = 1, g = 0, h = 0, lower.tail = TRUE, log.p = FALSE, ...)
Arguments
x , q |
|
A |
double scalar, location parameter |
B |
double scalar, scale parameter |
g |
double scalar, skewness parameter |
h |
double scalar, elongation parameter |
log , log.p |
logical scalar, if |
... |
other parameters of function vuniroot2 |
n |
integer scalar, number of observations |
p |
|
lower.tail |
logical scalar, if |
Value
Function dGH returns the density and accommodates vector arguments A
, B
, g
and h
.
The quantiles x
can be either vector or matrix.
This function takes about 1/5 time of gk::dgh
.
Function pGH returns the distribution function, only taking scalar arguments and vector quantiles q
.
This function takes about 1/10 time of function gk::pgh
.
Function qGH returns the quantile function, only taking scalar arguments and vector probabilities p
.
Function rGH generates random deviates, only taking scalar arguments.
Examples
(x = c(NA_real_, rGH(n = 5L, g = .3, h = .1)))
dGH(x, g = c(0,.1,.2), h = c(.1,.1,.1))
p0 = seq.int(0, 1, by = .2)
(q0 = qGH(p0, g = .2, h = .1))
range(pGH(q0, g = .2, h = .1) - p0)
q = (-2):3; q[2L] = NA_real_; q
(p1 = pGH(q, g = .3, h = .1))
range(qGH(p1, g = .3, h = .1) - q, na.rm = TRUE)
(p2 = pGH(q, g = .2, h = 0))
range(qGH(p2, g = .2, h = 0) - q, na.rm = TRUE)
curve(dGH(x, g = .3, h = .1), from = -2.5, to = 3.5)