| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Statistics Toolbox |
| Contents | Index |
| Learn more about Statistics Toolbox |
| On this page… |
|---|
The multinomial pdf is
![]()
where x = (x1, ... , xk) gives the number of each of k outcomes in n trials of a process with fixed probabilities p = (p1, ... , pk) of individual outcomes in any one trial. The vector x has non-negative integer components that sum to n. The vector p has non-negative integer components that sum to 1.
The multinomial distribution is a generalization of the binomial distribution. The binomial distribution gives the probability of the number of "successes" and "failures" in n independent trials of a two-outcome process. The probability of "success" and "failure" in any one trial is given by the fixed probabilities p and q = 1–p. The multinomial distribution gives the probability of each combination of outcomes in n independent trials of a k-outcome process. The probability of each outcome in any one trial is given by the fixed probabilities p1, ... , pk.
The expected value of outcome i is npi. The variance of outcome i is npi(1 – pi). The covariance of outcomes i and j is –npipj for distinct i and j.
The following uses mnpdf to produce a visualization of a trinomial distribution:
% Compute the distribution
p = [1/2 1/3 1/6]; % Outcome probabilities
n = 10; % Sample size
x1 = 0:n;
x2 = 0:n;
[X1,X2] = meshgrid(x1,x2);
X3 = n-(X1+X2);
Y = mnpdf([X1(:),X2(:),X3(:)],repmat(p,(n+1)^2,1));
% Plot the distribution
Y = reshape(Y,n+1,n+1);
bar3(Y)
set(gca,'XTickLabel',0:n)
set(gca,'YTickLabel',0:n)
xlabel('x_1')
ylabel('x_2')
zlabel('Probability Mass')

Note that the visualization does not show x3, which is determined by the constraint x1 + x2 + x3 = n.
![]() | Lognormal Distribution | Multivariate Gaussian Distribution | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |