Mathematica 中磁盘像素的协方差矩阵
我想计算下图的协方差矩阵。基于像素。即将圆盘的每个黑色像素视为向量。
虽然下面的单位是厘米,但我使用的屏幕上每厘米有 32 个像素。
在协方差矩阵计算本身之前,我无法找出获取所有像素向量的方法。
frmXY = {{6.59, 1.59}, {33.41, 28.41}};
stim = {{10.85, 21.91, 0.97}, {16.8, 5.26, 0.97}, {11.78, 7.11, 0.97},
{12.64, 14.13, 0.97`}, {20.24, 16.16, 0.97}, {29.51, 8.06,1.53},
{22.42, 5.78, 1.53}, {27.13, 16.47, 1.53}}
Graphics[{EdgeForm[Thick],White, Rectangle @@ frmXY, Black,
Disk @@@ (stim /. {a_, b_, c_} :> {{a, b}, c})}, ImageSize -> 300]
I would like to compute the Covariance Matrix of the image below. Pixel based. That is considering each Black Pixel of the Disks as vectors.
While the units below are in centimeter, there are 32 pixels per cm on the screen I am using.
Ahead of the Covariance Matrix computation itself, I can`t figure out the way to obtain all the pixels vector.
frmXY = {{6.59, 1.59}, {33.41, 28.41}};
stim = {{10.85, 21.91, 0.97}, {16.8, 5.26, 0.97}, {11.78, 7.11, 0.97},
{12.64, 14.13, 0.97`}, {20.24, 16.16, 0.97}, {29.51, 8.06,1.53},
{22.42, 5.78, 1.53}, {27.13, 16.47, 1.53}}
Graphics[{EdgeForm[Thick],White, Rectangle @@ frmXY, Black,
Disk @@@ (stim /. {a_, b_, c_} :> {{a, b}, c})}, ImageSize -> 300]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从你的问题中不清楚什么构成了描述你的模型/系统的随机变量,我不明白你想要获取的协方差矩阵是什么。
但是,这里有一个简单的示例,展示了如何获取协方差矩阵并计算特征值和特征向量(基本上,重现您的第一个图)。
It is not clear from your question as to what constitutes the random variable that describes your model/system and I don't understand what it is that you're trying to take the covariance matrix of.
However, here's a simple example showing how to obtain the covariance matrix and compute the eigenvalues and eigenvectors (basically, reproduce your first plot).