g****y 发帖数: 199 | 1 you can use mvnrnd:
Random numbers from multivariate normal distribution
Syntax
R = mvnrnd(mu,sigma)
r = mvnrnd(mu,sigma,cases)
Description
R = mvnrnd(mu,sigma)
returns an n-by-d matrix R of random vectors chosen from the multivariate
normal distribution with
mean mu, and covariance sigma. mu is
an n-by-d matrix, and mvnrnd generates
each row of R using the corresponding row of mu. sigma is
a d-by-d symmetric positive semi-definite
matrix, or a d-by-d-by-n array.
If sigma is an array, mvnrnd g |
|
l***n 发帖数: 812 | 2 在Matlab里直接使用就好了
mvnrnd(MU,SIGMA,N)
如果你想看它的程序怎么遍的,可以去查看它的源程序 |
|
a****m 发帖数: 693 | 3
谢谢,
我的问题是partial correlation, 就是说是covariance的倒数,去做simulation的时
候,就是把correation matrix,倒数就得到了covariance,然后,MVNRND(Mean,
Covariance) sampling, 我在想,如果有一组数据,和另一组数据因为他们原来的
correlation matrix 不一样, 不知道他们合在一起,去求correlation,他们的范围在
哪里?
如果一个是负数,一个是正数,可能不知道他们的值是多少。 |
|