Use closures:

function f(a,b,c)
    # Closure:
    f_closure(a) = a+b+c

    #pass f_closure to optimum and it has access to b,c
    println(f_closure(a))
end

julia> f(3,5,6)
14





On Monday, September 28, 2015 at 2:46:45 PM UTC+2, Christopher Fisher wrote:
>
> I was wondering if there is a way to pass data through the optim function 
> using the nelder_mead algorithm. As far as I can tell, the only way to fit 
> a model to data is to declare the data as a global variable. I suspect this 
> results in poor performance. 
>

Reply via email to