特定分布的 pdf
我是 Matlab 新手。我想用 Matlab 检查随机矩阵行列式的所谓“对数定律”,但仍然不知道如何做。
对数定律:
设 A 为大小为 n × n 的随机伯努利矩阵(条目为独立同分布,取值为 +-1,概率为 1/2)。我们可能想要将 (log(det(A^2))-log(factorial(n-1)))/sqrt(2n) 的概率密度函数与高斯分布的 pdf 进行比较。对数定律表明,当 n 接近无穷大时,第一个的 pdf 将接近第二个的 pdf。
我的 Matlab 任务非常简单:检查比较,假设 n=100。有人知道该怎么做吗?
谢谢。
I am new to Matlab. I would like to check the so call "logarithmic law" for determinant of random matrices with Matlab, but still do not know how.
Logarithmic law:
Let A be a random Bernoulli matrix (entries are iid, taking value +-1 with prob. 1/2) of size n by n. We may want to compare the probability density function of (log(det(A^2))-log(factorial(n-1)))/sqrt(2n) with the pdf of Gaussian distribution. The logarithmic law says that the pdf of the first will approach to that of the second when n approaches infinity.
My Matlab task is very simple: check the comparison for, say n=100. Anyone knows how to do so?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
考虑以下实验:
请注意,对于大型矩阵,A*A 的行列式将太大而无法以双精度数字表示并将返回
Inf
。然而,我们只需要行列式的对数,并且存在其他方法来找到这个结果,使计算保持对数规模。在评论中,@yoda 建议使用特征值
detA2(i) = real(sum(log(eig(A^2))));
,我还发现了一个 在具有类似实现的 FEX 上提交(使用 LU 或 Cholesky 分解)Consider the following experiment:
Note that for large matrices, the determinant of A*A will be too large to represent in double numbers and will return
Inf
. However we only require the log of the determinant, and there exist other approachs to find this result that keeps the computation in log-scale.In the comments, @yoda suggested using the eigenvalues
detA2(i) = real(sum(log(eig(A^2))));
, I also found a submission on FEX that have a similar implementation (using LU or Cholesky decomposition)