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

double vector, quantiles

A

double scalar, location parameter A=0 by default

B

double scalar, scale parameter B>0. Default B=1

g

double scalar, skewness parameter g=0 by default (i.e., no skewness)

h

double scalar, elongation parameter h\geq 0. Default h=0 (i.e., no elongation)

log, log.p

logical scalar, if TRUE, probabilities p are given as \log(p).

...

other parameters of function vuniroot2

n

integer scalar, number of observations

p

double vector, probabilities

lower.tail

logical scalar, if TRUE (default), probabilities are Pr(X\le x) otherwise, Pr(X>x).

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)


[Package TukeyGH77 version 0.1.2 Index]