Quantcast

How do I maximize a function ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How do I maximize a function ?

Pranav Bhat
How do I obtain the maximum value of a function over an interval?

In R I would do something like:

f <- function(x) { x ^ 2}
optimize(f, c(0, 100), maximum=TRUE)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How do I maximize a function ?

John Myles White
Pkg.add("Optim")


then

using Optim


and follow this section of the docs: http://www.juliaopt.org/Optim.jl/stable/user/minimization/#minimizing-a-univariate-function

 --John

On Friday, November 18, 2016 at 7:29:28 PM UTC-8, Pranav Bhat wrote:
How do I obtain the maximum value of a function over an interval?

In R I would do something like:

f <- function(x) { x ^ 2}
optimize(f, c(0, 100), maximum=TRUE)
Loading...