Just putting this out here in the hope that someone has an idea:
I'm trying to fit a model to some targets using a minimum distance
estimator with NLopt. The objective function basically computes the
distance between model output given two parameters and the targets I set.
The structure is:
objective(parameters::Vector{Float64}, grad)
result = solvemodel(parameters)
result'*target
end
opt = Opt(:GN_CRS2_LM, 2)
lower_bounds!(opt, [numbers])
upper_bounds!(opt, [numbers])
xtol_rel!(opt,0.005)
(minf, minx, ret) = optimize(opt, [numbers])
When running this code, it stays busy for a while (which is expected, given
that one evaluation of the model takes about 3 minutes) before throwing a
MethodError, complaining `convert` has no method convert(::Type{Float64},
::Array{Float64,1}). I do get a `in callback catch` after every model
evaluation, but I'm not sure where this is coming from, as when I simply
evaluate objective() myself using some numbers, a value is returned without
error.