View source: R/wilson_hilferty.R
WH.normal | R Documentation |
Returns the Wilson-Hilferty transformation of random variables with chi-squared distribution.
WH.normal(x)
x |
vector or matrix of data with, say, |
Let T = D^2/p
be a random variable, where D^2
denotes the squared Mahalanobis
distance defined as
D^2 = (\bold{x} - \bold{\mu})^T \bold{\Sigma}^{-1} (\bold{x} - \bold{\mu})
Thus the Wilson-Hilferty transformation is given by
z = \frac{T^{1/3} - (1 - \frac{2}{9p})}{(\frac{2}{9p})^{1/2}}
and z
is approximately distributed as a standard normal distribution. This
is useful, for instance, in the construction of QQ-plots.
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.
Mahalanobis
x <- iris[,1:4]
z <- WH.normal(x)
par(pty = "s")
qqnorm(z, main = "Transformed distances QQ-plot")
abline(c(0,1), col = "red", lwd = 2, lty = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.