How to generate a true random series that sums to 1?

107 Views Asked by At

So, as the title states, I'm trying to generate a true random series that sums to 1. In essence, this should be very easy right? Well, I have many problems. Here's what I need: 20 asset classes, which must sum to 100% of a portfolio. All asset classes must return random variables between 0 and 100. So far, I've generated 19 random variables between 0 and 1, and then bound my results to get them to sum to 1 (fairly simply, simply sort your series, then subtract your interim numbers from each other and subtract your last number from 1, this bounds all of your results to 1 in a random manner).

My problem here, is that doing this will almost never create a situation where I have for example 90% in asset class 1, or 9 or whatever. By generating 20 classes, this forces all classes to be relatively small all the time.

I have been racking my brain on ways around this, be it by cascading the random series, shuffling the order, etc. But I always end up with one bias or another. I can't imagine that I'm the first person to need this type of random distribution so I imagine there is a solution out there, but I can't find it.

Any help would be greatly appreciated. For reference, I need this for a Montecarlo type simulation that I am running with Excel and a Frontline Optimisation module. I'm open to doing this in Matlab if it's more efficient as well.

Ultimately I would like to generate 1 million or more of these random portfolios and measure their outcomes.

Thanks

2

There are 2 best solutions below

0
On

First I don't understand what asset classes are. But what I can tell you is: if all your random variables are independent, you can't expect their sum equal to a given number because it is a less likely event. You may have them to have a math expectation to be a given number, but it doesn't mean that when you generate values for them, their sum equal to their math expectation.

In concept, you have to assume one of the variables are dependent so they can sum up and equal to a given number.

0
On

You say in a comment "what I mean is that I want to find in my 1 million scenarios a series where I will have 99% in asset class 1, and only 1% across all other series, another where I have 85% in class 5 and 15% across all other series, etc. In other words I need to generate 20 series of 1 million variables that have a max value around 100% and a min value around 0%"

You can do this, just draw a random number from $.1$ to $1$ as the maximum invested in one class. After that distribute the rest in other classes, restricting each to less than $0.1$ or the maximum from the first step. This meets what you say, but then you may complain that it doesn't simulate two classes that are almost $50\%$ each and all the others are small. The problem is that you have not clearly defined the space you want to sample. Once you do that, you can generate allocations that meet the requirement and throw away all the rest.

The central limit theorem says that you will tend to allocate about the same amount to each class if you take a random over $[0,1]$ for each class and then normalize. You can "improve" this by starting with a distribution peaked at the ends to increase the variance. The real solution is to think about the distribution you want.