Hello everyone,
I would like to optimize the function "fqp" as following:
a=c(0.2,0.3,0.4)
vcov=matrix(c(1,2,3,3,2,2,2,3,1),3,3)
c=2
fqp <- function(b) {t(b)%*%a-0.5*c*((t(b)%*%vcov)%*%b)}
with constraints like ((t(b)%*%vcov)%*%b) <= 0.5
Is there a function of doing it? Many thanks.
--
View this message in context:
http://www.nabble.com/Optimization%3A-non-liner-constraints-tp14841225p14841225.html
Sent from the R help mailing list archive at Nabble.com.
On Jan 15, 2008 9:46 AM, livia <yn19832 at msn.com> wrote:> > Hello everyone, > > I would like to optimize the function "fqp" as following: > > a=c(0.2,0.3,0.4) > vcov=matrix(c(1,2,3,3,2,2,2,3,1),3,3) > c=2 > fqp <- function(b) {t(b)%*%a-0.5*c*((t(b)%*%vcov)%*%b)} > > with constraints like ((t(b)%*%vcov)%*%b) <= 0.5 > > Is there a function of doing it? Many thanks.Try the quadprog package.