swarm-modeling
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: generating constrained random vectors


From: Sven N. Thommesen
Subject: Re: generating constrained random vectors
Date: Fri, 08 Oct 1999 22:18:32 -0500

At 06:17 PM 10/8/1999 -0700, you wrote:
M. Lang / S. Railsback writes:
>
> a. It seems impossible to have a vector of N values that are uniformly
> random between 0,1 and yet add up to 1. The constraint that they add up
> to one excludes a lot of values from the distribution. (How can they be
> uniformly distributed between 0 and 1 if it is impossible for 0.6 and
> 0.5 to both be in the vector?)

This makes sense, but it addresses a different problem than the original.
The question was not how to generate a N-element vector with each
element uniformly distributed over [0,1] such that the sum of elements
is 1, but rather how to randomly generate a N-element vector with each
entry between [0,1] such that the sum of elements is 1 and the vectors
generated are uniformly distributed over the N-dimensional simplex.

Jason

Well, so much for jumping in before thinking ;-\

My original "easy" solution does seem to have the property that it merely scales down a "big" hypercube to a smaller one, thus leaving out the corners of the simplex. It seems Steve Upton's solution is likely to be better.

And on a practical note, if you need uniform doubles between 0.0 and 1.0, you don't need the uniformDouble distribution object; any generator will give you that.

Sven



                 ==================================
  Swarm-Modelling is for discussion of Simulation and Modelling techniques
  esp. using Swarm.  For list administration needs (esp. [un]subscribing),
  please send a message to <address@hidden> with "help" in the
  body of the message.
                 ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]