フィルターのクリア

random number of two random varibles.

1 回表示 (過去 30 日間)
eden meirovich
eden meirovich 2021 年 4 月 28 日
コメント済み: Jeff Miller 2021 年 4 月 28 日
i have 2 random varibles, w and T. they both a ranom varibles of 2 varibles a density function ( f(,w,T)).
is there a way to create a number like rand for this case? i have 2 cases:
where w and T are both uniform disturbiution and where they both gaussian (and might have corelation)
Thank you

回答 (2 件)

Image Analyst
Image Analyst 2021 年 4 月 28 日
Did you see the rand() and randn() functions?
w = rand(1, 10000);
T = rand(1, 10000);
w = theMean + stDev * randn(1, 1000);
T = theMean + stDev * randn(1, 1000);
Adapt as needed.
Not sure how to correlate the w with T, but there's probably an option or function for doing that.

Bruno Luong
Bruno Luong 2021 年 4 月 28 日
編集済み: Bruno Luong 2021 年 4 月 28 日
If K is the (2 x 2) covariariance matrix of (w,T) and mu (2 x 1) is the mean of (w,T), you can generate them like this
n = 1000; % number of samples
L = chol(K);
X = mu + L'*randn(2,n);
w = X(1,:)
T = X(2,:)
  1 件のコメント
Jeff Miller
Jeff Miller 2021 年 4 月 28 日
This is for the case of two normals. For the case of two correlated uniforms, you could adapt the method given in response to this question.

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

カテゴリ

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