Generating 0 and 1 from Poisson Distribution

1 回表示 (過去 30 日間)
Syed Ghazi Sarwat
Syed Ghazi Sarwat 2020 年 3 月 20 日
編集済み: Syed Ghazi Sarwat 2020 年 4 月 9 日
I am trying to create N vectors of dimension (1,M) that comprise only 0 and 1, picked from some Poisson distribution with mean lambda. I then want to correlate the 1's between the vectors with some correlation coefficeint ? Any suggestions how I can do this ? Thanks in advance

採用された回答

Samatha Aleti
Samatha Aleti 2020 年 3 月 24 日
You may generate 0,1 from Poisson Distribution using “poissrnd” function as follows:
M = 10;
poissrnd(0.25,1,M)
Refer the following link for documentation of “poissrnd :
  1 件のコメント
Syed Ghazi Sarwat
Syed Ghazi Sarwat 2020 年 4 月 9 日
編集済み: Syed Ghazi Sarwat 2020 年 4 月 9 日
This works, thank you. Will you be able to advice on the second part of the question. In say a 10 vectors each of dimension 1 by 100, I would like to correlate 50 with some correlation coefficient and others not. Thanks

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

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by