[R] constrained input for optimization algorithm

Zhi Xie zhi.xie at jhmi.edu
Fri Jul 31 08:20:44 CEST 2009


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 but mutual exclusive. 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