how to simulate 10000 samples from a multinomial distribution with p1=0.5,p2=0.3p3=0.2

4 visualizaciones (últimos 30 días)
how to simulate 10000 samples from a multinomial distribution with p1=0.5,p2=0.3p3=0.2

Respuesta aceptada

Star Strider
Star Strider el 28 de Mzo. de 2015
Editada: Star Strider el 28 de Mzo. de 2015
Use the mnrnd function in the Statistics Toolbox:
n = 1E+5; % Number Of Trials
p = [0.5, 0.3, 0.2]; % Vector Of Probabilities
r = mnrnd(n, r); % Output: Random Numbers
Does this do what you want?

Más respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by