Drawing random values of N for given z and p in a binomial process

5 ビュー (過去 30 日間)
Matan Mazor
Matan Mazor 2017 年 4 月 7 日
コメント済み: Matan Mazor 2017 年 4 月 7 日
Hi all,
I know that a given coin with a certain bias p was flipped an unknown number of times N, and came up heads z times. Both z and p are known, and I want to draw random samples of N from this distribution. The pdf of this distribution is
negativebinopdf = @(z,N,theta) (z/N)*(nchoosek(N,z))*(theta.^z).*((1-theta).^(N-z));
I don't know how I can draw random numbers of N for this distribution. Anyone has a clue?
Thanks!
-Matan

採用された回答

Torsten
Torsten 2017 年 4 月 7 日
https://de.mathworks.com/help/stats/nbinrnd.html
Best wishes
Torsten.

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by