mmle: Maximum Likelihood Estimation for Matrix Normal Distribtuion

View source: R/RcppExports.R

mmleR Documentation

Maximum Likelihood Estimation for Matrix Normal Distribtuion

Description

mmle computes the Maximum Likelihood Estimators (MLEs) for the matrix normal distribution using the iterative flip-flop algorithm \insertCiteDutilleul1999robustmatrix.

Usage

mmle(
  X,
  cov_row_init = NULL,
  cov_col_init = NULL,
  diag = "none",
  max_iter = 100L,
  lambda = 0,
  silent = FALSE,
  nthreads = 1L
)

Arguments

X

a 3d array of dimension (p,q,n), containing n matrix-variate samples of p rows and q columns in each slice.

cov_row_init

matrix. Initial cov_row p \times p matrix. Identity by default.

cov_col_init

matrix. Initial cov_col p \times p matrix. Identity by default.

diag

Character. If "none" (default) all entries of cov_row and cov_col are estimated. If either "both", "row", or "col" only the diagonal entries of the respective matrices are estimated.

max_iter

upper limit of iterations.

lambda

a smooting parameter for the rowwise and columnwise covariance matrices.

silent

Logical. If FALSE (default) warnings and errors are printed.

nthreads

Integer. If 1 (default), all computations are carried out sequentially. If larger then 1, matrix multiplication in the flip-flop algorithm is carried out in parallel using nthreads threads. Be aware of the overhead of parallelization for small matrices and or small sample sizes. If < 0, all possible threads are used.

Value

A list containing the following:

mu

Estimated p \times q mean matrix.

cov_row

Estimated p times p rowwise covariance matrix.

cov_col

Estimated q times q columnwise covariance matrix.

cov_row_inv

Inverse of cov_row.

cov_col_inv

Inverse of cov_col.

norm

Frobenius norm of squared differences between covariance matrices in final iteration.

iterations

Number of iterations of the mmle procedure.

References

\insertAllCited

See Also

For robust parameter estimation use mmcd.

Examples

n = 1000; p = 2; q = 3
mu = matrix(rep(0, p*q), nrow = p, ncol = q)
cov_row = matrix(c(1,0.5,0.5,1), nrow = p, ncol = p)
cov_col = matrix(c(3,2,1,2,3,2,1,2,3), nrow = q, ncol = q)
X <- rmatnorm(n = 1000, mu, cov_row, cov_col)
par_mmle <- mmle(X)

robustmatrix documentation built on June 8, 2025, 10:34 a.m.