QQ Plot for Multivariate Normal Variance Mixtures
Visual goodness-of-fit test for multivariate normal variance mixtures: Plotting squared Mahalanobis distances against their theoretical quantiles.
qqplot_maha(x, qmix, loc, scale, plot.diag = TRUE, verbose = TRUE,
control = list(), ...)x |
(n, d)-data |
qmix |
see |
loc |
see |
scale |
see |
plot.diag |
|
verbose |
see |
control |
|
... |
additional arguments (for example, parameters) passed to the
underlying mixing distribution when |
If X follows a multivariate normal variance mixture, the distribution of
the Mahalanobis distance D^2 = (X-μ)^T Σ^{-1} (X-μ)
is a gamma mixture whose distribution function can be approximated.
The function qqplot_maha() plots the empirical Mahalanobis distances
from the data in x (with μ=loc and
Sigma=scale) versus their theoretical quantiles which are
internally estimated via the function qgammamix().
qqplot_maha() (invisibly) returns a list of two: maha2, the
sorted Mahalanobis distances of the data in x with respect to
loc and scale and q, the theoretical quantiles evaluated
at ppoints(n) where n=nrow(x).
Erik Hintz, Marius Hofert and Christiane Lemieux
Hintz, E., Hofert, M. and Lemieux, C. (2020), Normal variance mixtures: Distribution, density and parameter estimation. https://arxiv.org/abs/1911.03017.
McNeil, A. J., Frey, R. and Embrechts, P. (2015). Quantitative Risk Management: Concepts, Techniques, Tools. Princeton University Press.
## Setup n <- 15 d <- 2 df <- 3.1 # degree-of-freedom parameter loc <- rep(0, d) scale <- diag(d) ## Define the quantile function of an IG(nu/2, nu/2) distribution qmix <- function(u, df) 1 / qgamma(1 - u, shape = df/2, rate = df/2) ## Sample data set.seed(1) # for reproducibility x <- rnvmix(n, qmix = qmix, df = df, loc = loc, scale = scale) ## QQ Plot of empirical quantiles vs true quantiles, all values estimated ## via RQMC: qqplot_maha(x, qmix = qmix, loc = loc, scale = scale, df = df) ## Same could be obtained by specifying 'qmix' as string in which case ## qqplot_maha() calls qf() qqplot_maha(x, qmix = "inverse.gamma", loc = loc, scale = scale, df = df)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.