I'm developing a portfolio optimisation code with constraints using monte-carlo simulation. However, I have run into a problem. My problem is as follows:
I have a list of instruments ["Multi", "Equity 1", "Equity 2", "Equity 3", "FI", "Cash"]
And I would like to generate a list of random numbers for these instruments e.g.
weights (random numbers) = [xx, xx, xx, xx, xx, xx]
However, with multiple constraints such as :
- All weights between 0.05 and 0.20.
- Weight of say "Cash" must be between 0 and 0.10 (i.e. the 0<= weights[-1] <= 0.10)
- Weight of "Equity 1" has to be 0.15 (i.e. weights[1] = 0.15)
Is there anyway that I can generate random numbers that satisfy all these criteria? and of course the sum of all weights must be equal to one.
Thank you all for your help!