Thanks for the quick reply!

My problem is one-dimensional. Here is the code:

using Optim
a=2
f(x)=-(x-a)^2
optimize(f,3)


I get:
ERROR: no method optimize(Function, Int64)

I am running Version 0.3.0-prerelease+3884 (2014-06-25 10:41 UTC) and have 
updated all packages.

Thanks for your help
Mathieu

On Tuesday, July 8, 2014 2:48:24 PM UTC-4, John Myles White wrote:
>
> This should work, except that you're not providing any initial values for 
> x. Is your problem one-dimensional or multi-dimensional? 
>
>  -- John 
>
> On Jul 8, 2014, at 11:44 AM, Mathieu Taschereau-Dumouchel <
> [email protected] <javascript:>> wrote: 
>
> > I am trying to optimize a simple function that takes a parameter as an 
> argument. Something like: 
> > 
> > a=2 
> > f(x)=-(x-a)^2 
> > optimize(f) 
> > 
> > Is there any way to do this? I have played quite a bit with optimize 
> without success. 
> > 
> > Thanks a lot 
> > Mathieu 
>
>

Reply via email to