[R] fastICA package: C, R codes provide vastly different results
Ranjan Maitra
maitra.mbox.ignored at inbox.com
Thu Jan 17 23:01:13 CET 2013
Dear friends,
I have been trying out the C and the R codes in the fastICA package.
However, it turns out that these often give vastly different results,
especially when row.norm is set to T. This happens even though I have
initialized the input matrix to be exactly the same for both of them.
Here is an example:
### cut code here
xx <- read.table(file =
"http://maitra.public.iastate.edu/SharadUtshob05.dat")
win <- matrix(c(-0.434590, 1.288207, -0.597128, -0.501621, 1.434678,
0.812076, -1.281559, -1.798178, 0.409151), ncol = 3)
library(fastICA)
adeflate.C <- fastICA(X = xx, alg.typ="deflation", row.norm=T,
w.init=win, n.comp=3, fun = "logcosh", method = "C")
adeflate.R <- fastICA(X = xx, alg.typ="deflation", row.norm=T,
w.init=win, n.comp=3, fun = "logcosh", method = "R")
### end code here.
The answers follow: note that the final un-mixing matrix estimate W is
not even close to each other.
adeflate.R$W
[,1] [,2] [,3]
[1,] -0.85074291 -0.2385149 0.4683451
[2,] 0.02907471 -0.9110909 -0.4111789
[3,] -0.52477726 0.3361905 -0.7820388
adeflate.C$W
[,1] [,2] [,3]
[1,] -0.001317682 -0.9904552102 -0.137828767
[2,] -0.006132130 0.1378342956 -0.990436316
[3,] 0.999980330 -0.0004598964 -0.006255222
Can anyone throw light on this matter?
On the other hand, using row.norm = F provides the following results:
adeflate.R$W
[,1] [,2] [,3]
[1,] -0.86309623 -0.2103872 0.4591319
[2,] -0.01433631 -0.8985285 -0.4386811
[3,] -0.50483598 0.3852062 -0.7725003
which is not as much different (but still quite different) from
adeflate.C$W
[,1] [,2] [,3]
[1,] -0.83111268 0.2247869 0.5086478
[2,] -0.01217191 0.9070906 -0.4207594
[3,] -0.55597085 -0.3558897 -0.7511584
What is the problem? Am I assuming something here that i should not in
my inputs?
Many thanks again for any help!
Best wishes,
Ranjan
--
Important Notice: This mailbox is ignored: e-mails are set to be
deleted on receipt. For those needing to send personal or professional
e-mail, please use appropriate addresses.
____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails
More information about the R-help
mailing list