在 Matlab 中使用 FastICA 分离高斯矩阵和泊松矩阵的混合

发布于 2024-12-21 14:08:50 字数 1493 浏览 2 评论 0原文

我需要生成一个具有高斯分布的矩阵(值主要从 -5 到 5)、一个泊松矩阵,将它们混合并将它们作为 Matlab FastICA

我是 Matlab、发行版和 ICA 的新手,所以一些建议确实会有帮助。我一直在努力,但不知道自己是否走在正确的道路上。

为了生成高斯矩阵和泊松矩阵,我生成了两个数组:

s2 = poissrnd(2, 1, 40000); %Poisson distribution with lambda 2
s1 = rand(size(s2)) * 10 - 5; %Gaussian distribution and values ranging from -5 to 5

然后使用 reshape 函数生成两个 200x200 矩阵。使用 image 时,我得到以下图像:

在此处输入图像描述

我的第一个问题是这是:这是在 Matlab 中生成高斯矩阵和泊松矩阵的正确方法吗?或者是否有一些内置函数可以实际生成矩阵,而不必生成和重塑数组?

现在,第二个问题:使用 FastICA

参考一个非常好的答案:ICA(独立分量分析)快速-定点算法,它提到FastICA需要连续的每个信号。

因此,我通过以下方式生成信号矩阵:

S(1,:) = s1; %row 1
S(2,:) = s2; %row 2

然后生成一个混合矩阵,添加一些噪声,并将所得矩阵作为 fastica() 函数的输入。

我的问题是:是否可以将2D数据直接提供给FastICA?如果您有一张包含许多混合信号的图像并希望将其提供给 ICA 以便其找到独立分量,该怎么办?

解释如何在不同输入上使用 FastICA 的教程链接将非常有帮助。

预先感谢所有阅读这篇文章并试图提供帮助的人。对于这个冗长的问题感到抱歉,我想确保它被很好地理解!

I need to generate a matrix with a Gaussian distribution (with values spread mainly from -5 to 5), a Poisson matrix, mix them and give them as input to the Matlab FastICA.

I am a newbie on Matlab, distributions and ICA, so a few pointers would really help. I have been trying really hard but don't know whether I'm on the right track.

In order to generate the Gaussian and Poisson matrices, I generated two arrays:

s2 = poissrnd(2, 1, 40000); %Poisson distribution with lambda 2
s1 = rand(size(s2)) * 10 - 5; %Gaussian distribution and values ranging from -5 to 5

I then use the reshape function to generate two 200x200 matrices. When using image, I get the following images:

enter image description here

My 1st question is this: Is this the correct way to generate Gaussian and Poisson matrices in Matlab? Or are there some built-in functions which actually generate the matrices, instead of having to generate and reshape arrays?

Now, the 2nd problem: using FastICA.

Referring to a very good answer at: ICA (Independent Component Analysis) fast-fixed point algorithm, it mentions that FastICA needs each signal in a row.

I am therefore generating my signal matrix by:

S(1,:) = s1; %row 1
S(2,:) = s2; %row 2

I then generate a mixing matrix, add some noise, and give the resultant matrix as input to the fastica() function.

My question is: is it possible to give 2D data directly to FastICA? What if you have an image with many mixed signals and want to give it to ICA so that it can find the Independent Components?

A link to a tutorial explaining how to use FastICA on different inputs would be very helpful.

Thanks in advance to anyone who reads this post and tries to help. And sorry for the lengthy question, I wanted to make sure that it is well understood!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沒落の蓅哖 2024-12-28 14:08:50

如何创建混合信号? FastICA 将尝试估计您用于混合的矩阵(原始组件)。只要您的观测(信号)有足够数量的测量,FastICA 就可以分解任意数量的混合信号。看,在您链接到的答案中,四个信号正在混合和分解。

您放入 FastICA 的数据已经是 2D (mxn),只是整形为另一个尺寸 (1 x mn)。

How do you create you mixed signal? FastICA will try to estimate the matrix you used for mixing (the original components). As long as you have a sufficient number of measurements for your observations (signals) FastICA can unmix any number of mixed signals. See, in the answer you linked to, four signals are being mixed and decomposed.

The data you put into FastICA already is 2D (m x n), just shaped to another size (1 x mn).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文