Hi,
   I am trying to use Rsolnp in a portfolio optimization context.  While I
know that my current example is solvable as QP, my risk function, which is
variance right now, could become more complicated later.  Basically, I want
to start with an equal weighted portfolio, and then minimize risk with a
tracking error constraint.  I was able to achieve this relatively easily
with fmincon in matlab, so I am wondering what the issue is here.

My reproducible code is below:

library(Matrix)
library(Rsolnp)
upper.tri <- c(17.82, 19.84, 4.96, 4, 3.79, 1.62, -.05,
               35.67, 6.83, 3.52, 2.72, 1.07, -.07,
               5.12, 3.52, 3.22, 1.81, .01,
               6.18, 6.36, 3.24, .04,
               7.95, 3.80, .05,
               2.47, .06,
               .04)
cov.mat <- matrix(0, ncol = 7, nrow = 7)
cov.mat[lower.tri(cov.mat, diag = TRUE)] <- upper.tri
cov.mat <- t(cov.mat)
cov.mat <- as.matrix(forceSymmetric(cov.mat))
wInit <- rep(1,7)/7
x.init <- rep(0, 2*7)
eq.fun <- function(x, sigma, wInit){
    sum(x[1:7]) - sum(x[8:14])
}
ob.fun <- function(x, sigma, wInit){
    wgts <- wInit + x[1:7] - x[8:14]
    as.numeric(wgts%*%sigma%*%wgts)
}
ineq.fun <- function(x, sigma, wInit){
    sum(x[1:7])
}
tst <- solnp(x.init, fun = ob.fun, eqfun = eq.fun, eqB = 0, ineqfun =
ineq.fun, ineqLB = 0, ineqUB = .1, LB = rep(0, 14), UB = rep(1,14), sigma =
cov.mat, wInit = wInit)

Thank you for the help,
-Bob

	[[alternative HTML version deleted]]

