Wolfram Function Repository
Instantuse addon functions for the Wolfram Language
Function Repository Resource:
Decompose a matrix into Independent Component Analysis matrix factors
ResourceFunction["IndependentComponentAnalysis"][mat,k] decomposes the matrix mat into k components. 

ResourceFunction["IndependentComponentAnalysis"][mat,k,opts] decomposes mat using the options opts. 
"InitialUnmixingMatrix"  Automatic  initial unmixing matrix 
"NegEntropyFactor"  1  negative entropy factor 
"NonGaussianityFunction"  Automatic  nonGaussianity measure function 
"RowNorm"  False  whether to normalize the matrix rows at each step 
MaxSteps  200  maximum steps of the ICA interation process 
PrecisionGoal  6  precision goal 
Here is a random integer matrix:
In[1]:= 

Out[3]= 

Here are the Independent Component Analysis matrix factors:
In[4]:= 

Out[5]= 

Here is the matrix product of the obtained factors:
In[6]:= 

Out[6]= 

Here is a random matrix with its first two columns having much larger magnitudes than the rest:
In[7]:= 

Out[8]= 

Compute the ICA matrix factors:
In[9]:= 

Here is the relative error of the approximation by the obtained matrix factorization:
In[10]:= 

Out[10]= 

Here is the relative error for the first three columns:
In[11]:= 

Out[11]= 

Here are comparison plots:
In[12]:= 

Out[12]= 

Using the option "InitialUnmixingMatrix", we can influence the results by providing initial unmixing matrix for ICA's iteration process. Here we compute ICA with different initial unmixing matrices:
In[13]:= 

Here we plot the results:
In[14]:= 

Out[14]= 

ICA is essentially a Gram–Schmidt process that considers two signals to be orthogonal if their difference is Gaussian noise.
Here we compute ICA with different nonGaussianity measure functions:
In[15]:= 

Plot the results:
In[16]:= 

Out[16]= 

Note that we used a small number of steps in order to obtain similar but different results. Using a sufficiently large number of steps (say, 20) we get almost the same results (with the matrix mat).
Here are signal generating functions:
In[17]:= 

Here is a mixing matrix:
In[18]:= 

Form a matrix of the signals:
In[19]:= 

Out[10]= 

In[20]:= 

Out[20]= 

Create the mixed signals matrix:
In[21]:= 

Out[22]= 

Find the ICA decomposition:
In[23]:= 

Approximation norm:
In[24]:= 

Out[24]= 

Visualize the ICAidentified source signals:
In[25]:= 

Out[25]= 

The ICA computations can be sensitive to the presence of outliers. Here we add a small number of outliers to the original mixed signals:
In[26]:= 

Out[16]= 

Here we apply ICA to the new mixed signals:
In[27]:= 

We see that the found components are not that good compared to the components found for the original mixed signals data:
In[28]:= 

Out[28]= 

This work is licensed under a Creative Commons Attribution 4.0 International License