| MLmatrixnorm | R Documentation |
Maximum likelihood estimates exist for N > max(p/q,q/p)+1 and are
unique for N > max(p,q). This finds the estimate for the mean and then
alternates between estimates for the U and V matrices until
convergence. An AR(1), compound symmetry, correlation matrix, or independence
restriction can be proposed for either or both variance matrices. However, if
they are inappropriate for the data, they may fail with a warning.
MLmatrixnorm(
data,
row.mean = FALSE,
col.mean = FALSE,
row.variance = "none",
col.variance = "none",
tol = 10 * .Machine$double.eps^0.5,
max.iter = 100,
U,
V,
...
)
data |
Either a list of matrices or a 3-D array with matrices in dimensions 1 and 2, indexed by dimension 3. |
row.mean |
By default, |
col.mean |
By default, |
row.variance |
Imposes a variance structure on the rows. Either
'none', 'AR(1)', 'CS' for 'compound symmetry', 'Correlation' for a
correlation matrix, or 'Independence' for
independent and identical variance across the rows.
Only positive correlations are allowed for AR(1) and CS covariances.
Note that while maximum likelihood estimators are available (and used) for
the unconstrained variance matrices, |
col.variance |
Imposes a variance structure on the columns. Either 'none', 'AR(1)', 'CS', 'Correlation', or 'Independence'. Only positive correlations are allowed for AR(1) and CS. |
tol |
Convergence criterion. Measured against square deviation between iterations of the two variance-covariance matrices. |
max.iter |
Maximum possible iterations of the algorithm. |
U |
(optional) Can provide a starting point for the |
V |
(optional) Can provide a starting point for the |
... |
(optional) additional arguments can be passed to |
Returns a list with a the following elements:
meanthe mean matrix
scalingthe scalar variance parameter (the first entry of the covariances are restricted to unity)
Uthe between-row covariance matrix
Vthe between-column covariance matrix
iterthe number of iterations
tolthe squared difference between iterations of the variance matrices at the time of stopping
logLikvector of log likelihoods at each iteration.
convergencea convergence flag, TRUE if converged.
callThe (matched) function call.
Pierre Dutilleul. The MLE algorithm for the matrix normal distribution. Journal of Statistical Computation and Simulation, (64):105–123, 1999.
Gupta, Arjun K, and Daya K Nagar. 1999. Matrix Variate Distributions. Vol. 104. CRC Press. ISBN:978-1584880462
rmatrixnorm() and MLmatrixt()
set.seed(20180202)
# simulating from a given density
A <- rmatrixnorm(
n = 100, mean = matrix(c(100, 0, -100, 0, 25, -1000), nrow = 2),
L = matrix(c(2, 1, 0, .1), nrow = 2), list = TRUE
)
# finding the parameters by ML estimation
results <- MLmatrixnorm(A, tol = 1e-5)
print(results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.