Posted by
Hurd, Matthew on
Sep 07, 2004; 1:06am
URL: http://quantlib.414.s1.nabble.com/random-generation-of-constrained-portfolio-allocation-weights-tp3309p3319.html
The below distribution will not be uniformly random (depending on what
this means to you), but neither will rejecting illegal cases.
Using your [0-40] example:
1. Random first number 20-40. Has to be at least 20 otherwise no viable
solution.
2. Next random number to give a sum of at least 60, so the last number
may be valid (it has to be <= 40). That is, if the first number is 35,
then the second number must be [25-40] to make a viable triple.
3. Obviously, the third number is 100 - sum of the first two.
Trivial to generalise.
Is that what you're after?
Regards,
Matt Hurd.
_________________
Matt Hurd
+61.2.8226.5029
[hidden email]
Susquehanna
_________________
> -----Original Message-----
> From:
[hidden email]
[mailto:quantlib-users-
>
[hidden email]] On Behalf Of Ferdinando Ametrano
> Sent: Tuesday, 7 September 2004 12:53 AM
> To: QuantLib-users
> Subject: [Quantlib-users] random generation of constrained portfolio
> allocation weights
>
> Hi all
>
> 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)
>
> I have no problem for the unconstrained generation, using
(quasi)random
> sequences of dimension 3 that I normalize so that their sum is 100%.
I'm
> not sure this approach is on solid theoretical ground, but it works.
>
> Anyway when it comes to constrained generation many problems arise,
and I
> haven't found an efficient generation algorithm. Rejection of the
> unconstrained portfolio is inefficient, of course.
>
> Hints, suggestions, thoughts?
>
> Even better would be a ready to be coded algorithm ;-)
>
> ciao -- Nando
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
>
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click> _______________________________________________
> Quantlib-users mailing list
>
[hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quantlib-usersIMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.