Movatterモバイル変換


[0]ホーム

URL:


Mean Vector and Covariance MatrixEstimation under Heavy Tails

Daniel P. Palomar, Rui Zhou,and Xiwen Wang
The Hong Kong University of Science and Technology (HKUST)

2023-04-29


This vignette illustrates the usage of the packagefitHeavyTailto estimate the mean vector and covariance matrix of heavy-tailedmultivariate distributions such as the angular Gaussian, Cauchy, orStudent’s\(t\) distribution. Theresults are compared against existing benchmark functions from differentpackages.

Installation

The package can be installed fromCRAN orGitHub:

# install stable version from CRANinstall.packages("fitHeavyTail")# install development version from GitHubdevtools::install_github("convexfi/fitHeavyTail")

To get help:

library(fitHeavyTail)help(package = "fitHeavyTail")?fit_mvt

To citefitHeavyTailin publications:

citation("fitHeavyTail")

Quick Start

To illustrate the simple usage of the packagefitHeavyTail,let’s start by generating some multivariate data under a Student’s\(t\) distribution with significant heavytails (degrees of freedom\(\nu=4\)):

library(mvtnorm)  # package for multivariate t distributionN <- 10   # number of variablesT <- 80   # number of observationsnu <- 4   # degrees of freedom for heavy tailsset.seed(42)mu <- rep(0, N)U <- t(rmvnorm(n = round(0.3*N), sigma = 0.1*diag(N)))Sigma_cov <- U %*% t(U) + diag(N)  # covariance matrix with factor model structureSigma_scatter <- (nu-2)/nu * Sigma_covX <- rmvt(n = T, delta = mu, sigma = Sigma_scatter, df = nu)  # generate data

We can first estimate the mean vector and covariance matrix via thetraditional sample estimates (i.e., sample mean and sample covariancematrix):

mu_sm     <- colMeans(X)Sigma_scm <- cov(X)

Then we can compute the robust estimates via the packagefitHeavyTail:

library(fitHeavyTail)fitted <- fit_mvt(X)

We can now compute the estimation errors and see the significantimprovement:

sum((mu_sm     - mu)^2)#> [1] 0.2857323sum((fitted$mu - mu)^2)#> [1] 0.1487845sum((Sigma_scm  - Sigma_cov)^2)#> [1] 5.861138sum((fitted$cov - Sigma_cov)^2)#> [1] 3.031499

To get a visual idea of the robustness, we can plot the shapes of thecovariance matrices (true and estimated ones) on two dimensions. Observehow the heavy-tailed estimation follows the true one more closely thanthe sample covariance matrix:

Numerical Comparison with Existing Packages

In the following, we generate multivariate heavy-tailed Student’s\(t\) distributed data and compare theperformance of many different existing packages via 100 Monte Carlosimulations in terms of estimation accurary, measured by the meansquared error (MSE) and CPU time.

The following plot gives a nice overall perspective of the MSEvs. CPU time tradeoff of the different methods (note the ellipse at thebottom left that embraces the best four methods:fitHeavyTail::fit_Tyler(),fitHeavyTail::fit_Cauchy(),fitHeavyTail::fit_mvt(), andfitHeavyTail::fit_mvt() with fixednu = 6):

From the numerical results we can draw several observations:

Concluding, the top choices seem to be (in order):

  1. fitHeavyTail::fit_mvt() (either without fixingnu or withnu = 6),
  2. fitHeavyTail::fit_Cauchy(),
  3. fitHeavyTail::fit_Tyler(), and
  4. MASS::cov.trob() (with the advantage of beingpreinstalled with base R, but with a worse estimation error).

The overall winner isfitHeavyTail::fit_mvt() by a bigmargin.

Extension to Skewed Distributions

The empirical distribution of daily returns of some financialvariables, such as exchange rates, equity prices, and interest rates, isoften skewed. There are several different formulations of multivariateskewed\(t\) distributions appearing inthe literature(Lee and McLachlan, 2014)(Aas and Haff, 2006). The package nowsupports the multivariate generalized hyperbolic (GH) skewed\(t\) distribution and provides a method toestimate the parameters of such distribution. It is implemented in thefunctionfitHeavyTail::fit_mvst(). Below is a simpleexample to illustrate its usage:

# parameter setting for GH Skewed t distributionN <- 5T <- 200nu <- 6mu <- rnorm(N)scatter <- diag(N)gamma <- rnorm(N)# generate GH Skew t data via hierarchical structuretaus <- rgamma(n = T, shape = nu/2, rate = nu/2)X <- matrix(data = mu, nrow = T, ncol = N, byrow = TRUE) +     matrix(data = gamma, nrow = T, ncol = N, byrow = TRUE) / taus +     mvtnorm::rmvnorm(n = T, mean = rep(0, N), sigma = scatter) / sqrt(taus)# fit GH Skew t modelfitted <- fit_mvst(X)

Algorithms

In essence, all the algorithms are based on the maximum likelihoodestimation (MLE) of some assumed distribution given the observed data.The difficulty comes from the fact that the optimal solution to such MLEformulations becomes too involved in the form of a fixed-point equationand the framework of Majorization-Minimization (MM) algorithms(Sunet al., 2017) becomes key to derive efficient algorithms.

In some cases, the probability distribution function becomes toocomplicated to manage directly (like the multivariate Student’s\(t\) distribution) and it is necessary toresort to a hierarchical distribution that involves some latentvariables. In order to deal with such hidden variables, one has toresort to the Expectation-Maximization (EM) algorithm, whichinterestingly is an instance of the MM algorithm.

The following is a concise description of the algorithms used by thethree fitting functions (note that the current version of the R packagefitHeavyTaildoes not allow yet a regularization term with a target):

References

Aas, K., and Haff, I. H. (2006). The generalized hyperbolic skewstudent’st-distribution.Journal of Financial Econometrics,4(2), 275–309.
Lee, S., and McLachlan, G. J. (2014). Finite mixtures of multivariateskew t-distributions: Some recent and new results.Statistics andComputing,24(2), 181–202.
Liu, C., and Rubin, D. B. (1995).ML estimation of thet-distribution usingEM and its extensions,ECM andECME.Statistica Sinica,5(1), 19–39.
Liu, C., Rubin, D. B., and Ying Nian Wu, and. (1998). Parameterexpansion to accelerateEM: ThePX-EMalgorithm.Biometrika,85(4), 755–770.
Ollila, E., Palomar, D. P., and Pascal, F. (2021).Shrinking theeigenvalues ofM-estimators of covariance matrix.IEEE Transactions on Signal Processing,69, 256–269.
Pascal, F., Ollila, E., and Palomar, D. P. (2021).Improvedestimation of the degree of freedom parameter of multivariatet-distribution.
Sun, Y., Babu, P., and Palomar, D. P. (2014).RegularizedTyler’s scatter estimator: Existence, uniqueness, andalgorithms.IEEE Trans. Signal Processing,62(19),5143–5156.
Sun, Y., Babu, P., and Palomar, D. P. (2015).Regularized robustestimation of mean and covariance matrix under heavy-taileddistributions.IEEE Trans. Signal Processing,63(12), 3096–3109.
Sun, Y., Babu, P., and Palomar, D. P. (2017).Majorization-minimizationalgorithms in signal processing, communications, and machinelearning.IEEE Transactions on Signal Processing,65(3), 794–816.
Zhou, R., Liu, J., Kumar, S., and Palomar, D. P. (2019).Robust factor analysis parameterestimation.Lecture Notes in Computer Science (LNCS).

[8]ページ先頭

©2009-2025 Movatter.jp