Hi,
   I am running into a memory issue when I try to run a mean-CVaR
optimization on a large number of scenarios.  I am running R 32-bit on
windows (see sessionInfo() output below).  I have attached code to display
the problem below (using a sample from a random multi-variate normal
distribution as an example, though that is not what I am actually doing.)
I am using the methodology proposed by Uryasev (thanks to  Guy Yollin for
the cvarOpt function) to formulate the problem as an LP.  When I have a
small number of asset classes, I can arrive at good (though sometimes non
"optimal" for a given set of scenarios) solutions using different
optimizers (DEoptim, BBoptim, Rsolnp) where I don't run into the scenario
size constraint.  However, when I increase the number of asset classes, the
non-LP solvers do a worse and worse job of finding a stable "global"
optimum, with the exception of DEoptim which will arrive at a good
solution, but will take a very long time for, say, 25 asset classes and
10,000 scenarios.  The LP, on the other hand, seems much more sensitive to
number of scenarios than to the number of asset classes.
Thanks in advance,
-Bob

## Code
library(Rglpk)
library(mvtnorm)
mu <- c(.04, .06, .1)
sig <- c(.04, .09, .2)
cor.mat <- rbind(c( 1, .6, .2),
                 c(.6, 1, .1),
                 c(.2, .1, 1)
                 )
v.cov <- sig%o%sig*cor.mat
set.seed(100)
n <- 1000 ##works
n <- 10000##doesn't work due to memory error
samps <- rmvnorm(n, mean = mu, sigma = v.cov)
cvarOpt <- function(rmat, alpha = .05, rmin = .05, wmin = 0, wmax = 1,
weight.sum =1){
    nAss = ncol(rmat) # number of assets
    s = nrow(rmat) # number of scenarios i.e. periods
    averet = colMeans(rmat)
    ##create objective vector, constraint matrix, constraint rhs
    Amat =
rbind(cbind(rbind(1,averet),matrix(data=0,nrow=2,ncol=s+1)),cbind(rmat,diag(s),1))

    objL = c(rep(0,nAss), rep(-1/(alpha*s), s), -1)
    bvec = c(weight.sum,rmin,rep(0,s))
    ##direction vector
    dir.vec = c("==",">=",rep(">=",s))
    ##bounds on weights
    bounds = list(lower = list(ind = 1:nAss, val = rep(wmin,nAss)),upper =
list(ind = 1:nAss, val = rep(wmax,nAss)))
    res = Rglpk_solve_LP(obj=objL, mat=Amat, dir=dir.vec, rhs=bvec,
types=rep("C",length(objL)), max=T, bounds=bounds)
    w = as.numeric(res$solution[1:nAss])
    return(list(w=w,status=res$status))
}
ans.cvar <- cvarOpt(rmat = samps, rmin = .08)

## session info

R version 2.13.2 (2011-09-30)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] mvtnorm_0.9-9991 Rglpk_0.3-5      slam_0.1-22

loaded via a namespace (and not attached):
[1] tools_2.13.2

	[[alternative HTML version deleted]]

