Re: using random with constraints



Anna Chen wrote:
hello,
i would like to generate random vectors that have the constraint that the components should sum to zero, and that the components are picked from some distribution.

It's extremely easy to get the first thing, simply generate a vector and subtract off the mean. But "some distribution" is rather vague. What distribution? Do you care what distribution? For example, this

x = rand(1,10); x = x - mean(x);

draws from the "modified 10-dimensional shifted uniform distribution" that I just made up. I bet that isn't the distribution that you're looking for.

Hope this helps.
.



Relevant Pages


Loading