Hi,
I am using constrOptim for a linear optimization problem. But it is giving
an error that initial value is not feasible, even though the initial value
provided is feasible.
I am using the following code.
------------------Code----------------
fr<-function(x){
x1=x[1]
x2=x[2]
x3=x[3]
x4=x[4]
x5=x[5]
x6=x[6]
x7=x[7]
x8=x[8]
x9=x[9]
x10=x[10]
2*x1+3*x2+4*x3-6*x4+x5+3*x8-4*x9+x10}
x0<-c(0,0,0,0,0,0,0,0,1.4,0)
Amat<-
matrix(c(1,3,4,2,-2,-3,2,-1,0,6,2,4,1,-2,5,3,0,-3,-4,0,5,6,1,1,0,1,3,-1,-1,1,0,0,5,0,5,0,1,2,2,-2,1,4,-6,-3,-2,-1,5,2,1,0,-1,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,-1),10,15)
bvec<-c(1,-2,-1,3,5,0,0,0,0,0,0,0,0,0,0)
constrOptim(x0,fr,NULL,ui=-t(Amat),ci=-bvec)
----------------------------------------------------------
Can anyone help me with this.
Thanks
Amit
[[alternative HTML version deleted]]