I'm thinking about optim()
in R or optimize()
in Python's scipy
. Both can minimize a function, and both can maximize a function by minimizing the inverted function. My question is: why are both coded to minimize rather than maximize? Is it just down to the numerical techniques they use (e.g., Nelder-Mead)?
Asked
Active
Viewed 39 times
-1

invictus
- 1,821
- 3
- 25
- 30
1 Answers
1
most (all?) solvers have minimization as the default behavior. Not sure what the historical reasons are for that... perhaps some of the early applications were all minimizing penalties instead of maximizing "goodness", but the standardization is sure nice.
Some frameworks have option to change the "sense" from min to max, but it is just syntactic sugar and as easy as negating the objective function. (Not sure what "inverted" function implies.)

AirSquid
- 10,214
- 2
- 7
- 31