[R] constrained input for optimization algorithm

Zhi Xie xiezhi at gmail.com
Thu Jul 30 21:43:11 CEST 2009


Hi all,

It seems that optimization algorithm, optim, tries to find optimized
parameters within defined lower and upper bounds. In my problem, all
the parameters are integers. My question is that if there is any means
that I can let "optim" only tries mutual exclusive integers. To be
specific, I am giving an example here.

I tried to find a set parameters with five elements with the lowest
value for the cost function. The parameter set that "optim" returned
is "5, 5, 49, 51, 51". However, I only wanted to search unique
parameter values, such as "5, 6, 49, 50, 51".

Many thanks,

Zhi Xie

Johns Hopkins School of Medicine
Baltimore, MD




More information about the R-help mailing list