fit_mvt {fitHeavyTail}R Documentation

Estimate parameters of a multivariate Student's t distribution to fit data

Description

Estimate parameters of a multivariate Student's t distribution to fit data, namely, the mean vector, the covariance matrix, the scatter matrix, and the degrees of freedom. The data can contain missing values denoted by NAs. It can also consider a factor model structure on the covariance matrix. The estimation is based on the maximum likelihood estimation (MLE) and the algorithm is obtained from the expectation-maximization (EM) method.

Usage

fit_mvt(
  X,
  na_rm = TRUE,
  nu = c("iterative", "kurtosis", "MLE-diag", "MLE-diag-resampled", "cross-cumulants",
    "all-cumulants", "Hill"),
  nu_iterative_method = c("POP", "OPP", "OPP-harmonic", "ECME", "ECM", "POP-approx-1",
    "POP-approx-2", "POP-approx-3", "POP-approx-4", "POP-exact", "POP-sigma-corrected",
    "POP-sigma-corrected-true"),
  initial = NULL,
  optimize_mu = TRUE,
  weights = NULL,
  scale_covmat = FALSE,
  PX_EM_acceleration = TRUE,
  nu_update_start_at_iter = 1,
  nu_update_every_num_iter = 1,
  factors = ncol(X),
  max_iter = 100,
  ptol = 0.001,
  ftol = Inf,
  return_iterates = FALSE,
  verbose = FALSE
)

Arguments

X

Data matrix containing the multivariate time series (each column is one time series).

na_rm

Logical value indicating whether to remove observations with some NAs (default is TRUE). Otherwise, the NAs will be imputed at a higher computational cost.

nu

Degrees of freedom of the t distribution. Either a number (>2) or a string indicating the method to compute it:

  • "iterative": iterative estimation (with method to be specified in argument nu_iterative_method) with the rest of the parameters (default method);

  • "kurtosis": one-shot estimation based on the kurtosis obtained from the sampled moments;

  • "MLE-diag": one-shot estimation based on the MLE assuming a diagonal sample covariance;

  • "MLE-diag-resampled": like method "MLE-diag" but resampled for better stability.

nu_iterative_method

String indicating the method for iteratively estimating nu (in case nu = "iterative"):

  • "ECM": maximization of the Q function [Liu-Rubin, 1995];

  • "ECME": maximization of the log-likelihood function [Liu-Rubin, 1995];

  • "OPP": estimator from paper [Ollila-Palomar-Pascal, TSP2021, Alg. 1];

  • "OPP-harmonic": variation of "OPP";

  • "POP": improved estimator as in paper [Pascal-Ollila-Palomar, EUSIPCO2021, Alg. 1] (default method).

initial

List of initial values of the parameters for the iterative estimation method (in case nu = "iterative"). Possible elements include:

  • mu: default is the data sample mean,

  • cov: default is the data sample covariance matrix,

  • scatter: default follows from the scaled sample covariance matrix,

  • nu: can take the same values as argument nu, default is 4,

  • B: default is the top eigenvectors of initial$cov multiplied by the sqrt of the eigenvalues,

  • psi: default is diag(initial$cov - initial$B %*% t(initial$B)).

optimize_mu

Boolean indicating whether to optimize mu (default is TRUE).

weights

Optional weights for each of the observations (the length should be equal to the number of rows of X).

scale_covmat

Logical value indicating whether to scale the scatter and covariance matrices to minimize the MSE estimation error by introducing bias (default is FALSE). This is particularly advantageous when the number of observations is small compared to the number of variables.

PX_EM_acceleration

Logical value indicating whether to accelerate the iterative method via the PX-EM acceleration technique (default is TRUE) [Liu-Rubin-Wu, 1998].

nu_update_start_at_iter

Starting iteration (default is 1) for iteratively estimating nu (in case nu = "iterative").

nu_update_every_num_iter

Frequency (default is 1) for iteratively estimating nu (in case nu = "iterative").

factors

Integer indicating number of factors (default is ncol(X), so no factor model assumption).

max_iter

Integer indicating the maximum number of iterations for the iterative estimation method (default is 100).

ptol

Positive number indicating the relative tolerance for the change of the variables to determine convergence of the iterative method (default is 1e-3).

ftol

Positive number indicating the relative tolerance for the change of the log-likelihood value to determine convergence of the iterative method (default is Inf, so it is not active). Note that using this argument might have a computational cost as a convergence criterion due to the computation of the log-likelihood (especially when X is high-dimensional).

return_iterates

Logical value indicating whether to record the values of the parameters (and possibly the log-likelihood if ftol < Inf) at each iteration (default is FALSE).

verbose

Logical value indicating whether to allow the function to print messages (default is FALSE).

Details

This function estimates the parameters of a multivariate Student's t distribution (mu, cov, scatter, and nu) to fit the data via the expectation-maximization (EM) algorithm. The data matrix X can contain missing values denoted by NAs. The estimation of nu if very flexible: it can be directly passed as an argument (without being estimated), it can be estimated with several one-shot methods (namely, "kurtosis", "MLE-diag", "MLE-diag-resampled"), and it can also be iteratively estimated with the other parameters via the EM algorithm.

Value

A list containing (possibly) the following elements:

mu

Mu vector estimate.

scatter

Scatter matrix estimate.

nu

Degrees of freedom estimate.

mean

Mean vector estimate:

mean = mu
cov

Covariance matrix estimate:

cov = nu/(nu-2) * scatter
converged

Boolean denoting whether the algorithm has converged (TRUE) or the maximum number of iterations max_iter has been reached (FALSE).

num_iterations

Number of iterations executed.

cpu_time

Elapsed CPU time.

B

Factor model loading matrix estimate according to cov = (B %*% t(B) + diag(psi) (only if factor model requested).

psi

Factor model idiosynchratic variances estimates according to cov = (B %*% t(B) + diag(psi) (only if factor model requested).

log_likelihood_vs_iterations

Value of log-likelihood over the iterations (if ftol < Inf).

iterates_record

Iterates of the parameters (mu, scatter, nu, and possibly log_likelihood (if ftol < Inf)) along the iterations (if return_iterates = TRUE).

Author(s)

Daniel P. Palomar and Rui Zhou

References

Chuanhai Liu and Donald B. Rubin, "ML estimation of the t-distribution using EM and its extensions, ECM and ECME," Statistica Sinica (5), pp. 19-39, 1995.

Chuanhai Liu, Donald B. Rubin, and Ying Nian Wu, "Parameter Expansion to Accelerate EM: The PX-EM Algorithm," Biometrika, Vol. 85, No. 4, pp. 755-770, Dec., 1998

Rui Zhou, Junyan Liu, Sandeep Kumar, and Daniel P. Palomar, "Robust factor analysis parameter estimation," Lecture Notes in Computer Science (LNCS), 2019. <https://arxiv.org/abs/1909.12530>

Esa Ollila, Daniel P. Palomar, and Frédéric Pascal, "Shrinking the Eigenvalues of M-estimators of Covariance Matrix," IEEE Trans. on Signal Processing, vol. 69, pp. 256-269, Jan. 2021. <https://doi.org/10.1109/TSP.2020.3043952>

Frédéric Pascal, Esa Ollila, and Daniel P. Palomar, "Improved estimation of the degree of freedom parameter of multivariate t-distribution," in Proc. European Signal Processing Conference (EUSIPCO), Dublin, Ireland, Aug. 23-27, 2021. <https://doi.org/10.23919/EUSIPCO54536.2021.9616162>

See Also

fit_Tyler, fit_Cauchy, fit_mvst, nu_OPP_estimator, and nu_POP_estimator

Examples

library(mvtnorm)       # to generate heavy-tailed data
library(fitHeavyTail)

X <- rmvt(n = 1000, df = 6)  # generate Student's t data
fit_mvt(X)

# setting lower limit for nu
options(nu_min = 4.01)
fit_mvt(X, nu = "iterative")


[Package fitHeavyTail version 0.2.0 Index]