RE: random generation of constrained portfolio allocation weights
Posted by
ML-21 on
Sep 07, 2004; 4:58am
URL: http://quantlib.414.s1.nabble.com/random-generation-of-constrained-portfolio-allocation-weights-tp3309p3314.html
> I need to generate random weights for a
> portfolio allocation, with max constraints
> on the weights, no short sale allowed (e.g.
> 3 assets, each one in the [0%, 40%] range)
Generally you have 2N+1 inequalities:
0 <= x_i, i=1..N
x_i <= M_i, i=1..N
Sum[x_i, {i,1,N}] = 1
These inequalities define 2N+1 hyperplanes in the N-dimensional space. The volume enclosed by these hyperplanes is called a polytope (polygone in the planar case N=2).
Generating uniformly distributed random numbers on a multidimensional polytope is a rather difficult problem. See for instance
http://citeseer.ist.psu.edu/leydold98sweepplane.htmlIf there is interest, I'm happy to work on this issue and eventually contribute a good algorithm. For the time being, however, I guess the rejection method is a moderately good solution.
-Mario