Sampling from distribution summing up to some value
Mostrar comentarios más antiguos
Hello
I'm sampling 14 random numbers from a dirichlet distribution in the following way:
N = ones(14,1);
d = gamrnd(N , 1);
d = d./sum(d);
The values sum up to 1 but I want that they sum up to 14.
Is it valid to just multiply the values by 14, i.e. d = d * 14?
Second, do I have to initialize N with ones(14,1) or with ones(14,1) * (1/14)?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Uniform Distribution (Continuous) en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!