suppose that my function to be optimized is f <- function(theta,k){ z<-theta[1]; x <- theta[2] k*(z-x^2)^2 + (1-x)^2}
f <- function(theta,k){ z<-theta[1]; x <- theta[2] k*(z-x^2)^2 + (1-x)^2}
And I want to write an op