ajd {jointDiag} | R Documentation |
Wrapper: Joint approximate diagonalization of a set of matrices
Description
This function is mainly a wrapper to the different algorithms provided in the package. So see the help of the different algorithms for the details.
Usage
ajd(M, A0 = NULL, B0 = NULL, eps = .Machine$double.eps,
itermax = 200, keepTrace = FALSE, methods = c("jedi"))
Arguments
M |
DOUBLE ARRAY (KxKxN). Three-dimensional array with dimensions KxKxN representing the set of square and real-valued matrices to be jointly diagonalized. N is the number of matrices. Matrices are KxK square matrices. |
A0 |
DOUBLE MATRIX (KxK). The initial guess of the inverse of a joint diagonalizer. If NULL, an initial guess is automatically generated by the algorithm. |
B0 |
DOUBLE MATRIX (KxK). The initial guess of a joint diagonalizer. If NULL, an initial guess is automatically generated by the algorithm. |
eps |
DOUBLE. The algorithm stops when the criterion difference between two iterations is less than eps. |
itermax |
INTEGER. Alternatively, the algorithm stops when itermax sweeps have been performed without reaching convergence. If the maximum number of iteration is performed, a warning appears. |
keepTrace |
BOOLEAN. Do we want to keep the successive estimations of the joint diagonalizer. |
methods |
STRING. One or more methods, choosen among the set of available algorithms. Possible values are: jedi, ffdiag, jadiag, uwedge, qdiag |
Details
This function is mainly a wrapper to use the different algorithms provided in the package (see help of the different functions).
Value
If the number of methods is one, the result is the structure provided by the algorithm used.
If the number of methods is more than one, a list of results provided by each algorithm is given. Names of the list correspond to methods.
Author(s)
Cedric Gouy-Pailler (cedric.gouypailler@gmail.com)
Examples
# generating diagonal matrices
D <- replicate(30, diag(rchisq(df=1,n=10)), simplify=FALSE)
# Mixing and demixing matrices
B <- matrix(rnorm(100),10,10)
A <- solve(B)
C <- array(NA,dim=c(10,10,30))
for (i in 1:30) C[,,i] <- A %*% D[[i]] %*% t(A)
ajd(C,method=c("jedi","ffdiag"))