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]]