Keith,
check the section 3 code. For optim() to function (excuse the pun) properly, you
need to ensure that it takes elements of vector as arguments, rather than
discrete x/y values, since this is the input that follows from the "par"
command. i.e. rather than
out <- x + y
experiment with
toy <- function(x)
x1 <- x[1]
x2 <- x[2]
and then substitute x1 for x and x2 for y in the function for 3.
Hope this helps.
Oliver
For the multivariate optim() function, I am having
trouble figuring
out why I am getting the following error message:
optim(par = sval , fn = fkt3...
"Error in fn(par, ...) : argument "y" is missing, with no default"
I do not believe it is a problem in how the f(x) was written, because
I can evaluate fkt3 at some values for x and y. A problem arises when
I try to put it into some function like optim() where I do not
specify some particular x and y.
_______________________________________________
gov2001-l mailing list
gov2001-l at
lists.fas.harvard.edu
http://lists.fas.harvard.edu/mailman/listinfo/gov2001-l
--
Graduate Student
Department of Government
Harvard University
Cambridge, MA