Sampling from distribution summing up to some value
Afficher commentaires plus anciens
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)?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Uniform Distribution (Continuous) dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!