Description Usage Arguments Details Value Author(s) References Examples
This function performs a Joint Approximate Diagonalization of a set of square and real-valued matrices.
1 2 |
C0 |
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. |
V0 |
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 criterium 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. |
Given a set C_i of N KxK real-valued matrices, the algorithm is looking for a matrix B such that \forall i \in [1,N], B C_i B^T is as close as possible of a diagonal matrix.
B |
Estimation of the Joint Diagonalizer. |
criter |
Successive estimates of the cost function across sweeps. |
B_trace |
Array of the successive estimates of B across iterations. |
Cedric Gouy-Pailler (cedric.gouypailler@gmail.com), from the initial matlab code by A. Ziehe.
A. Ziehe, P. Laskov, G. Nolte and K.-R. Mueller; A Fast Algorithm for Joint Diagonalization with Non-orthogonal Transformations and its Application to Blind Source Separation; Journal of Machine Learning Research vol 5, pages 777-800, 2004
1 2 3 4 5 6 7 8 9 10 11 | # 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)
B_est <- ffdiag(C)$B
# B_est should be an approximate of B=solve(A)
B_est %*% A
# close to a permutation matrix (with random scales)
|
[,1] [,2] [,3] [,4] [,5]
[1,] 8.326673e-17 -6.938894e-17 -1.734723e-17 -9.020562e-17 2.081668e-17
[2,] -2.081668e-16 -8.326673e-17 1.110223e-16 -2.775558e-17 -8.326673e-17
[3,] 3.524797e-01 -4.163336e-17 -1.734723e-17 -6.245005e-17 -1.040834e-17
[4,] -2.428613e-17 -1.734723e-17 -5.204170e-17 -2.909972e-01 -6.938894e-18
[5,] -2.081668e-17 -2.659156e-01 3.469447e-17 2.775558e-17 1.387779e-17
[6,] 1.734723e-16 -1.665335e-16 -2.775558e-17 -2.775558e-17 9.714451e-17
[7,] 1.249001e-16 -7.632783e-17 6.938894e-18 -2.775558e-17 -3.000890e-01
[8,] 3.122502e-17 4.163336e-17 -5.204170e-17 -1.387779e-17 6.245005e-17
[9,] 5.551115e-17 1.387779e-17 1.526557e-16 -8.326673e-17 1.387779e-17
[10,] -7.632783e-17 1.040834e-16 3.213566e-01 -7.632783e-17 -2.081668e-17
[,6] [,7] [,8] [,9] [,10]
[1,] 2.220446e-16 -1.387779e-17 4.163336e-17 3.765010e-01 1.665335e-16
[2,] -3.031041e-01 4.163336e-17 0.000000e+00 1.110223e-16 1.110223e-16
[3,] 3.469447e-17 -5.204170e-17 5.551115e-17 -4.163336e-17 0.000000e+00
[4,] 9.714451e-17 1.734723e-17 2.775558e-17 1.387779e-17 2.220446e-16
[5,] -1.665335e-16 -6.938894e-18 -5.551115e-17 5.551115e-17 -5.551115e-17
[6,] 2.775558e-17 -6.938894e-17 3.049161e-01 -8.326673e-17 1.110223e-16
[7,] -5.551115e-17 -9.020562e-17 -2.775558e-17 -2.775558e-17 -1.110223e-16
[8,] 5.551115e-17 -3.645798e-01 2.775558e-17 -8.326673e-17 -5.551115e-17
[9,] -1.110223e-16 2.081668e-17 -5.551115e-17 1.110223e-16 -5.670969e-01
[10,] 1.179612e-16 -3.122502e-17 8.326673e-17 1.526557e-16 -2.220446e-16
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.