letterValue {TukeyGH77}R Documentation

Letter-Value Estimation of Tukey gg-&-hh Distribution

Description

Letter-value based estimation (Hoaglin, 1985) of Tukey gg-, hh- and gg-&-hh distribution. All equation numbers mentioned below refer to Hoaglin (1985).

Usage

letterValue(
  x,
  g_ = seq.int(from = 0.15, to = 0.25, by = 0.005),
  h_ = seq.int(from = 0.15, to = 0.35, by = 0.005),
  halfSpread = c("both", "lower", "upper"),
  ...
)

Arguments

x

double vector, one-dimensional observations

g_

double vector, probabilities used for estimating gg parameter. Or, use g_ = FALSE to implement the constraint g=0g=0 (i.e., an hh-distribution is estimated).

h_

double vector, probabilities used for estimating hh parameter. Or, use h_ = FALSE to implement the constraint h=0h=0 (i.e., a gg-distribution is estimated).

halfSpread

character scalar, either to use 'both' for half-spreads (default), 'lower' for half-spread, or 'upper' for half-spread.

...

additional parameters, currently not in use

Details

Unexported function letterV_g() estimates parameter gg using equation (10) for gg-distribution and the equivalent equation (31) for gg-&-hh distribution.

Unexported function letterV_B() estimates parameter BB for Tukey gg-distribution (i.e., g0g\neq 0, h=0h=0), using equation (8a) and (8b).

Unexported function letterV_Bh_g() estimates parameters BB and hh when g0g\neq 0, using equation (33).

Unexported function letterV_Bh() estimates parameters BB and hh for Tukey hh-distribution, i.e., when g=0g=0 and h0h\neq 0, using equation (26a), (26b) and (27).

Function letterValue plays a similar role as fitdistrplus:::start.arg.default, thus extends fitdistrplus::fitdist for estimating Tukey gg-&-hh distributions.

Value

Function letterValue returns a 'letterValue' object, which is double vector of estimates (A^,B^,g^,h^)(\hat{A}, \hat{B}, \hat{g}, \hat{h}) for a Tukey gg-&-hh distribution.

Note

Parameter g_ and h_ does not have to be truly unique; i.e., all.equal elements are allowed.

References

Hoaglin, D.C. (1985). Summarizing Shape Numerically: The gg-and-hh Distributions. doi:10.1002/9781118150702.ch11

Examples

set.seed(77652); x = rGH(n = 1e3L, g = -.3, h = .1)
letterValue(x, g_ = FALSE, h_ = FALSE)
letterValue(x, g_ = FALSE)
letterValue(x, h_ = FALSE)
(m3 = letterValue(x))

library(fitdistrplus)
fit = fitdist(x, distr = 'GH', start = as.list.default(m3))
plot(fit) # fitdistrplus:::plot.fitdist


[Package TukeyGH77 version 0.1.2 Index]