9 views (last 30 days)

Dear all,

What code can I use in matlab to find the parameters of a binomial distribution? This question is very big. So I am restricting it to a specific situation.

X is binomiallly distributed with parameter n and fraction p. The parameter p is unknown.

What function in matlab can help me to find that parameter if for example it is known that X=randi(10,20,1); P(X<=4)=0.3?

Thank you in advance.

Star Strider
on 31 Jan 2019

Star Strider
on 1 Feb 2019

For that problem, this appears to be the correct approach:

X=randi(10,20,1);

Px4 = nnz(X <= 4)/numel(X); % Single Probability

[P,Pci] = binofit(Px4, numel(X)) % Binomial Probability Of A ‘Px4’ Fraction Of ‘X’ Being <= 4, Those Being Defined As A ‘Success’

If you run this several times, you will get different results for each iteration, depending on the elements of ‘X’. and therefore the value of ‘Px4’.

Sign in to comment.

Sign in to answer this question.

Opportunities for recent engineering grads.

Apply Today
## 0 Comments

Sign in to comment.