amari: Compute the 'Amari' distance between two matrices

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/amari.R

Description

The Amari distance is a measure between two nonsingular matrices. Useful for checking for convergence in ICA algorithms, and for comparing solutions.

Usage

1
amari(V, W, orth = FALSE)

Arguments

V

first matrix

W

second matrix

orth

are the matrices orthogonal; default is orth=FALSE

Details

Formula is given in second reference below, page 570.

Value

a numeric distance metween 0 and 1

Author(s)

Trevor Hastie

References

Bach, F. and Jordan, M. (2002). Kernel independent component analysis, Journal of Machine Learning Research 3: 1-48
Hastie, T., Tibshirani, R. and Friedman, J. (2009) Elements of Statistical Learning (2nd edition), Springer.
http://www-stat.stanford.edu/~hastie/Papers/ESLII.pdf

See Also

ProDenICA

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
dist="n" 
N=1024
p=2
A0<-mixmat(p)
s<-scale(cbind(rjordan(dist,N),rjordan(dist,N)))
x <- s %*% A0
###Whiten the data
x <- scale(x, TRUE, FALSE)
sx <- svd(x)	### orthogonalization function
x <- sqrt(N) * sx$u
target <- solve(A0)
target <- diag(sx$d) %*% t(sx$v) %*% target/sqrt(N)
W0 <- matrix(rnorm(2*2), 2, 2)
W0 <- ICAorthW(W0)
W1 <- ProDenICA(x, W0=W0,trace=TRUE,Gfunc=G1)$W
fit=ProDenICA(x, W0=W0,Gfunc=GPois,trace=TRUE, density=TRUE)
W2 <- fit$W
#distance of FastICA from target
amari(W1,target)
#distance of ProDenICA from target
amari(W2,target)

Hanchao-Zhang/ProDenICA documentation built on Jan. 17, 2022, 12:23 a.m.