my_Amari: The Amari Error

Description Usage Arguments Details Value Author(s) References Examples

View source: R/my_Amari.R

Description

Measures a distance between a mixing matrix inverse of A and an estimate of an unmixing matrix W.

Usage

1
my_Amari(A, W)

Arguments

A

The inverse of the mixing matrix

W

The estimated unmixing matrix

Details

This is an implementation of the algorithm found in Sorensen, J. 2008. An Assessment of Hermite Function-based Approximations of Mutual Information Applied to Independent Component Analysis. Entropy. Vol. 10. pp745-756

Sorensen, 2008 cites Amari et al. 1996 for the expression.

Value

The Amari Error/Distance

Author(s)

Hans-Peter Bakker

References

See details

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
set.seed(1)
A <- matrix(runif(4), nrow = 2)
set.seed(2)
W <- matrix(runif(4), nrow = 2)

my_Amari(solve(A), W)
[1] 0.6755254


##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (A, W) 
{
    AInv <- A
    WInv <- solve(W)
    m <- nrow(A)
    AInvWInv <- AInv %*% WInv
    terms1 <- rowSums(abs(AInvWInv))/apply(abs(AInvWInv), 1, 
        max) - 1
    terms2 <- colSums(abs(AInvWInv))/apply(abs(AInvWInv), 2, 
        max) - 1
    return(1/(2 * m) * (sum(terms1) + sum(terms2)))
  }

hanspeter6/icaPlay documentation built on May 2, 2020, 2:34 p.m.