gusl: (Default)
[personal profile] gusl
My refactoring fastICA was performing better than fastICA itself (better agreement with R), so I went hunting for the difference.

This is my "buggy" code:
    DoubleMatrix2D resultMatrix = (DoubleMatrix2D) inVectors.clone();

The "clone" is deceptive: essentially, resultMatrix is going to have the same pointers as inVectors... so changing entries in resultMatrix changes them in inVectors.

This is the correct way to clone:
    DoubleMatrix2D resultMatrix = new DenseDoubleMatrix2D(convert(inVectors));


I think there may be a mathematical reason why using the resultMatrix is superior to using inVectors, despite the FastICA implementation.

Another possibility is that the R implementation has the exact same bug as the one I introduced in my poorly-executed "cloning".
(will be screened)
(will be screened if not validated)
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

February 2020

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526272829

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags