why when I use mvrnd to generate random vectors from a multivariate normal I always get small numbers in absolute value ?

2 ビュー (過去 30 日間)
Hi, why when I use mvrnd to generate random vectors from a multivariate normal I always get small numbers in absolute value (not larger than 4 or 5)? E.g.
mu=[0 0];
sigma=[1 0.4; 0.4 1];
r=10000; %number of simulated unobservables
epsilon=mvnrnd(mu,sigma,r);
Thanks

採用された回答

Vaclav Rimal
Vaclav Rimal 2013 年 12 月 11 日
The width of the distribution is ruled by the diagonal elements of sigma. If you want larger absolute values, try scaling sigma, e.g.
sigma = [10 4; 4 10];
  2 件のコメント
MRC
MRC 2013 年 12 月 11 日
Thanks, but I would like to keep the variances equal to 1 and then the covariances should be between -1 and 1.
Vaclav Rimal
Vaclav Rimal 2013 年 12 月 11 日
編集済み: Vaclav Rimal 2013 年 12 月 11 日
But when the variances are v=1.0, the standard deviations of both vectors are supposed to be sqrt(v)=1.0, so there is only a little probability that a value exceeds the number 5 you mentioned. (99.7 % should have absolute values less than 3*sqrt(v), which you can test by sum(abs(epsilon)<3).) You simply cannot have v=1.0 and large numbers in the result.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by