File Exchange Pick of the Week

Our best user submissions

Uniform random samples with fixed sum

Thanks again to guest-picker-in-residence John D’Errico …

Yes, I’ll admit that I’m one of those people who enjoys a pretty piece of mathematics. Its something you will find in a randfixedsum, by Roger Stafford. Roger managed to find a way to compute uniform random samples that lie inside a hypercube, but still satisfy a sum constraint on the samples. Yes, I had figured out how to do that in 2 or 3 or 5 dimensions, but I was totally stymied when I tried to push my approach to higher numbers of dimensions. Roger’s code works (efficiently!) in higher dimensions with ease.

Its definitely not something you would need to use every day, but its worth a peek.

|
  • print
  • send email

댓글

댓글을 남기려면 링크 를 클릭하여 MathWorks 계정에 로그인하거나 계정을 새로 만드십시오.