Dear R users, I want to find the maximum value of v, subject to the constrain that the sum of x is equal to 1. So, I want to maximize: v<-t(x)%*%distance%*%x
Subject to: sum(x)=1 Where: "x" is a vector n X 1 "distance" is a matrix n*n and it is given. (In practive, the number of n can go up to hundreds.) I have a bit of experience using R but not much on optimization techniques or on R optimization packages. I have taken a look at optim and nlminb, but I am confused. Do you have any suggestion on how to do it? Thank you very much, Leo Monasterio. ______________________________________________ R-help@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.