JuliaNLSolvers / Optim.jl

Optimization functions for Julia
Other
1.12k stars 217 forks source link

Error in Optim #29

Closed marksale closed 11 years ago

marksale commented 11 years ago

Hi, I'm running Julia 0.2.0 on Windows (64 bit). Running the example in doc for Rosenbrock.

for the command: optimize(f, [0.0, 0.0])

or

optimize(f, [0.0, 0.0], method = :nelder_mead) error message was: ERROR: no method OptimizationResults(ASIIString,Array{Float64,1}.Array{Float64,1},Float64,Int32,Bool, Bool, OptimizationTrace,Int32, Int32, Array{Float64,1})

same result for the Curve Fit Demo

a two-parameter exponential model

model(xpts, p) = p[1]_exp(-xpts._p[2])

some example data

xpts = linspace(0,10,20) data = model(xpts, [1.0 2.0]) + 0.01*randn(length(xpts))

beta, r, J = curve_fit(model, xpts, data, [0.5, 0.5])

beta = best fit parameters

r = vector of residuals

J = estimated Jacobian at solution

We can use these values to estimate errors on the fit parameters. To get 95% confidence error bars:

errors = estimate_errors(beta, r, J)

Any ideas? thanks Mark

johnmyleswhite commented 11 years ago

I just updated METADATA to track the latest Optim. I don't see this error on my system.

I'm particularly by this line:

OptimizationResults(ASIIString,Array{Float64,1}.Array{Float64,1},Float64,Int32,Bool, Bool, OptimizationTrace,Int32, Int32, Array{Float64,1})

I don't remember that typo existing in the codebase, but it would certainly be a major source of problems.

marksale commented 11 years ago

Is there anything else I can do/send to help track it down?

thanks for your help Mark

marksale commented 11 years ago

BTW, I've been using Julia for just over a week now, it is very possible I don't have required package installed, or other issues. (along with the fact that I'm not actually a programmer, I'm an MD)

johnmyleswhite commented 11 years ago

If you have git on your system, it would be very helpful to know which revision of Optim you have installed on your system.

Before answering that, can you run Pkg.update()?

marksale commented 11 years ago

Hm, ran Pkg.update(), seems to work now. I had version 0.1.4., now have version 0.1.5. Sorry for the bother Mark

johnmyleswhite commented 11 years ago

Not a bother at all: I released 0.1.5 because of this.