Creating a matrix with the binomial distribution as entries.

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)

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

What is the Nmtx operation? Basically I need to create a matrix where the (i,j) entries of the 6x6 matrix correspond to the binomial distribution with parameters n=i-1 and p=1/4. I know what they should be just need helping coding that in.
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.

Sign in to comment.

Tags

Asked:

on 15 Oct 2016

Commented:

on 16 Oct 2016

Community Treasure Hunt

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

Start Hunting!