Skip to content
Prev 300956 / 398503 Next

Help with Portfolio Optmization

On Mon, Jul 23, 2012 at 6:24 AM, MaheshT <mahesh.msmf at gmail.com> wrote:
Well, no: you have to be a little smarter about it though: try to walk
through the example in ?solve.QP again.

The trick is to split the conditions and then note that

a < x < b -->
a < x & x < b -->
-x < -a & x < b -->

both of which are now of the form constant*x < bound so you can wrap
them up in a single matrix.

c(-1, 1) * x < c(-a, b)

Incidentally, this has already been solved for you here (inter alia):

https://systematicinvestor.wordpress.com/2011/12/13/backtesting-minimum-variance-portfolios/

For this sort of problem, you might also get better help on the
R-SIG-Finance lists.

Cheers,
Michael