MATLAB: Sampling from distribution summing up to some value

distributionrandom numberssampling

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)?

Best Answer

The arguments of GAMRND are the shape parameters of the distribution. Change them and you will change the distribution from which you draw the random values. That is not what you generally want.
You should define carefully what you mean by valid.
Related Question