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)?