[R] Optimizing problem R

kylmala kylmala at wippies.fi
Wed May 23 09:49:09 CEST 2012


I'have tried to do something like that staring values:

pars=c(x1=1,x2=1,x3=1,x4=1,x5=1,x6=1,x7=1)

and the function 

f=function(pars){
min(pars[1]/10,pars[2]/11)+min(pars[3]/20,pars[4]/22,pars[5]/25)+min(pars[6]/36,pars[7]/28)
}

optim(pars,f)

but how can I get the constraints in there also?

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



More information about the R-help mailing list