[R-sig-finance] Portfolio Wgts Optimization

Patrick Burns patrick at burns-stat.com
Wed Sep 21 10:59:06 CEST 2005


To answer your immediate question, one approach
is to add a Lagrange multiplier to your function.  Another
is to rescale the weights before computing the utility
(this has the potential to confuse the optimizer, but often
works okay).

But if you are using mean-variance utility, then you should
investigate the 'quadprog' package.  If your requirements
are more complex and you are willing to spend money,
then POP from Burns Statistics is a possibility.

Patrick Burns
patrick at burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")

Manoj wrote:

>Greeting,
>     Apologies for the blank email...I am quite new to optim function
>in R. I am trying to do the following:
>
>     I am trying to optimize Portfolio wgts subjected to certain
>constraints. The constraints are that individual weights can be either
>0 or maximum 40% and that the sum of the weights should be 1.
>
>      While I know that I can use L-BFGS-B method and specify the
>lower & upper bound, How can I specify the constraint that the sum of
>the weights should add up to 1?
>
>     Thanks in advance for your help.
>
>Cheers
>
>Manoj
>
>_______________________________________________
>R-sig-finance at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>
>
>  
>



More information about the R-sig-finance mailing list