Solved – maximization of a function with nlminb in R

extreme valuer

I know nlminb () takes a function, objective, and finds values for the parameters of this function at which the objective function achieves its minimum value and also it can be used to optimize functions with multiple arguments. Can it be used to find a point which maximizes the objective function with multiple arguments?If not, what other function in R can I maximize? In fact, I want to maximize the logarithm of likelihood function, which has an initial estimate of its parameters.

Best Answer

If you are looking to maximize instead of minimizing a function $f$, you can call nlminb on $-f$, since maximizing $f$ is equivalent to minimizing $-f$.

Other possible optimization functions are nlm and optim. See this answer for a comparison of these functions.

Related Question