Hi,


I have  function that I want to optimize.  Am playing with the optim() function in R

Two issues:

1) I can't seem to get it to work with a function that takes multiple inputs.

Dummy Example:

myFunc <- function(A,B,D,D){
	# Do stuff
	return E
}

> myFunc(1,2,3,4)
[1] 12
# works fine from command line

> optim( par=c(1,2,3,4), fn=myFunc)
Error in A+B  : 'B' is missing


2) For SOME of the inputs, I want to fix the step size to integers.  For another input, I  would also like to limit the range of possible values for each input

The help file in R isn't very clear on either of the above issues.

Any suggestions?

Thanks!


--
Noah Silverman
UCLA Department of Statistics
8117 Math Sciences Building #8208
Los Angeles, CA 90095


	[[alternative HTML version deleted]]

