[R] Constrained Optimisation

Russell2 bhargavaoswal at hotmail.co.uk
Mon Dec 19 20:32:37 CET 2011

Dear All

I have a constrained optimisation problem, I want to maximise the following

t(weights) %*% CovarianceMatrix %*% weights

for the weights, 

subject to  constraints on each element within the weights & the weights
vector  summing to 1.


weights = (x1, x2, x3), where x1 is within some given range (a +b, a - b).

I have tried to do this using the optim function in R, setting the minimum &
maximum tolerances as lower and upper bounds but once I set the constraint
of the weights summing to 1 in the function, it creates an error.

I have also looked at the constrOptim & solveQP packages and have similar
problems with constraint settings. 

Thanks in advance.

View this message in context: http://r.789695.n4.nabble.com/Constrained-Optimisation-tp4215341p4215341.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list