Re: Randomize three variables subject to sum always equal to 1

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Lars-Åke Aspelin (larske_at_REMOOOVEtelia.com)
Date: 09/04/04


Date: Sat, 04 Sep 2004 19:05:57 GMT

On Sat, 04 Sep 2004 02:50:43 GMT, "kcc" <kcconline@comcast.NOSPAM.com>
wrote:

>The problem, or it may be a problem depending on the original poster's need,
>is that most of the solutions do not produce 3 RV's with the same
>distribution.
 
And the one suggested below doesn't do that either.
We don't know if that is a problem or not as the original problem was
to vaguely defined when it comes to what "randomly selects" mean,

>Another way to think of the problem is to start with a pie. Generate 3 RV's
>where each defines the location of where to make a cut. 0 is at 12 o'clock,
>.5 at 6 o'clock, etc. These values would be transformed by defining 3 new
>RV's as the size of the slices. By definition, the sum will equal the
>whole.
>
>No VB is needed. Just use the following formulas:
>Row 1 has the uniformly dist RV's
>A1, B1 & C1=rand()
>Row 2 is the RV's sorted
>A2 = min(A1:C1), B2=large(A1:C1,2), C2=max(A1:C1)
>Then the desired RV's would be
>A3=B2-A2, B3=C2-B2, C3=1-C2+A2
>
>As with all the solutions, the RV's are not independent.
>It's been too many years for me to do the math, but the distribution
>appears to be exponential in shape with the highest density at 0
>and lowest at 1.
>If I could do the math, I also might prove a suspicion that the result is
>effectively the same as Tom's.
>

No, it is not the same as the "divide by the sum" result given by Tom
where the "RV's" do have the same distribution (for what it's worth).
Actually your "A2", "B2", and "C2" variables have the averages of
0.25, 0.5 and 0.75 respectively. That means that your
"A3", "B3" and "C3" variables have the averages of
0.25, 0.25 and 0.5 respectively. Thus the three "RV's" do not have
the same distrubution.

Lars-Åke


Quantcast