I have the following function:
I am interested in finding all the 4 local minima of this bivariate function using code in R. How can I go about it?
I have the following function:
I am interested in finding all the 4 local minima of this bivariate function using code in R. How can I go about it?
Copyright © 2021 Jogjafile Inc.
If you are interested in numerical optimization, you have several approaches possible. The most direct one is to use
optim
. By default, this is a Nelder-Mead simplex method but others are implemented.You will need to start from different starting values to converge to different end points. I can propose you the following:
And if you want to see graphically your solutions:
You have four local minima in this output