[R] linear constraints---absolute value

livia yn19832 at msn.com
Mon Jan 21 16:28:33 CET 2008


Hello,
I would like to optimize the function "fqp" as following:
a= c(0.2,0.3,0.4) 
vcov=matrix(c(1,2,3,4,5,6,7,8,9),3,3) 
fqp <- function(b) {t(b)%*%a-0.5*((t(b)%*%vcov)%*%b)} 

I want the linear constraint to be something  like abs(b1)+ abs(b2)+abs(b3)
= 1.5. 

I found it diffcult to use "constrOptim" in this case.

Could anyone give me some advice? Many thanks.


-- 
View this message in context: http://www.nabble.com/linear-constraints---absolute-value-tp14999843p14999843.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list