Creating a matrix with the binomial distribution as entries.
Show older comments
How can I create a 6 × 6 matrix with P (Xi = j − 1) in the (i, j)-position where Xi has the binomial distribution with parameters n = i−1 and p = 1/4.
Answers (1)
Star Strider
on 15 Oct 2016
I’m not certain what you’re asking. If I’m guessing correctly, the binornd function may be what you want.
See if this works:
Nmtx = [0:5]' * [1:6];
R = binornd(Nmtx, 1/4); % Output Matrix
Experiment with ‘Nmtx’ to get the result you want.
2 Comments
Shane Kosir
on 15 Oct 2016
Star Strider
on 16 Oct 2016
If you know what they should be, please post an example.
I have no idea what you want.
Once I know, coding it might be relatively straightforward.
Categories
Find more on Binomial Distribution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!