[R] solveRsocp in fPortfolio

From: Luis Felipe Parra <felipe.parra_at_quantil.com.co>
Date: Wed, 06 Apr 2011 06:32:51 +0800

Hello I am trying to use solveRsocp to optimize a Portfolio maximizing return. I was checking the code since I would like to solve it for a short Portfolio and I found this:

# C - Cone Constraints:

    C1 <- rep(0, nAssets)                                     # xCx
    C2 <- eqsumW[2, -1]                                       # sum(x)
    C3 <- rbind(diag(nAssets), -diag(nAssets) )               # x[i]>0

# d - Cone Constraints:
d1 <- targetRisk # xCx = risk d2 <- eqsumW[2, 1] # sum(x) <= 1 d3 <- c(rep(0, nAssets), rep(-1, nAssets)) # x[i] > 0

I was wondering if the conditions C3 and d3 aren't forcing the portfolio to be always a "LongOnly" portfolio? I tried modifying the code to take out these conditions and got the following error:

Error en .socp.phase1(f, A, b, N, control) : Phase 1 failed, alpha>=0

Does anybody knkow what might be going on? Is there any problem with this solver for negative weights?

Thank you

Felipe Parra

        [[alternative HTML version deleted]]

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 05 Apr 2011 - 22:36:18 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 05 Apr 2011 - 23:00:27 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive