wilson.hilferty {fastmatrix} | R Documentation |
Wilson-Hilferty transformation
Description
Returns the Wilson-Hilferty transformation of random variables with Gamma distribution.
Usage
wilson.hilferty(x, shape, rate = 1)
Arguments
x |
a numeric vector containing Gamma distributed deviates. |
shape , rate |
shape and rate parameters. Must be positive. |
Details
Let be a random variable following a Gamma distribution with parameters
=
shape
and =
rate
with density
where ,
,
and consider the random variable
. Thus, the Wilson-Hilferty transformation
is approximately distributed as a standard normal distribution. This is useful, for instance, in the construction of QQ-plots.
References
Terrell, G.R. (2003). The Wilson-Hilferty transformation is locally saddlepoint. Biometrika 90, 445-453.
Wilson, E.B., and Hilferty, M.M. (1931). The distribution of chi-square. Proceedings of the National Academy of Sciences of the United States of America 17, 684-688.
See Also
Examples
x <- rgamma(n = 300, shape = 2, rate = 1)
z <- wilson.hilferty(x, shape = 2, rate = 1)
par(pty = "s")
qqnorm(z, main = "Transformed Gamma QQ-plot")
abline(c(0,1), col = "red", lwd = 2, lty = 2)