1

I have asked this on stack overflow but couldn't get an answer. I am using the fastICA implementation in R. Example code:

library(fastICA)
#repeating ICA analysis 10 times
icaResults<-list()
for(i in 1:10) icaResults[[i]]<-fastICA(myMatrix, 5)$S

#calculating reproducibility of components
corMatrix<-matrix(nrow = 5, ncol=10)
ica1<-icaResults[[1]]
for(i in 2:10)
  for(c in 1:5)
    corMatrix[c, i]<-max( abs(cor(ica1[,c], icaResults[[i]])) )

It seems that the ICA doesn't give me the same results upont 10x repetition:

 > round(corMatrix, 3)

     [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]  [,8]  [,9] [,10]
[1,]   NA 0.933 0.997 0.996 0.951 0.985 0.651 0.998 0.999 0.992
[2,]   NA 0.980 0.994 0.994 0.992 0.943 0.875 0.992 0.995 1.000
[3,]   NA 0.975 0.990 0.990 0.995 0.945 0.837 0.986 0.992 1.000
[4,]   NA 0.921 0.995 0.995 0.943 0.885 0.740 0.993 0.996 1.000
[5,]   NA 0.996 0.998 0.996 1.000 0.994 0.998 0.998 1.000 0.992

The results are often similar but sometimes there is quite a variability in the resulting ica$S matrices. E.g. Repertition 7 in the code above seems to be quite different. I know that the order of the components can be random, but this problem is independent from the order. Why is that? Is that inherent to ICA analysis that there is some randomness? I noticed that it also depends on the actual values in the matrix and the number of components (for some matrices the results are more consistent than for others and it seems to be less consistent with more components).

UPDATE: I have update the code examples

StanW
  • 23
  • 6
  • cross-posted to SO.SE https://stackoverflow.com/questions/57903215/fastica-results-not-exactly-consistent-on-repetition – Sycorax Sep 18 '19 at 12:43
  • I can't reproduce these results because I don't have access to `myMatrix` and you have not set the seed. More information on how to make a reproducible example: https://stackoverflow.com/help/minimal-reproducible-example – Sycorax Sep 19 '19 at 13:23

1 Answers1

2

The first step of fastICA is to whiten the data using PCA. The signs of the eigenvectors of the covariance matrix are not uniquely determined. So it's not surprising that you find variations between runs.

More resources:

Sycorax
  • 76,417
  • 20
  • 189
  • 313
  • Wouldn't that mean that the signs of the ICA components are random? Or would that result in actually different values. E.g. if I repeat the above code on my data 10 times and I calculate for the resulting components from run 1 the absolute of highest correlation coefficient with components from the other runs I get correlations between 0.6 and 0.999. Never 1. – StanW Sep 18 '19 at 12:52
  • 1
    @StanW It sounds like you would like a more detailed answer. Please edit your original post to include a reproducible example, as well as a demonstration of what specific phenomenon you would like to know more about. – Sycorax Sep 18 '19 at 13:05
  • I have elaborated with the examples above – StanW Sep 19 '19 at 07:34