Closed juagudeloo closed 1 year ago
you could do:
f0 = x -> resid(x, data, sig, params)
optimize(f0, zeros(2), BFGS())
Yes, the solution is to use a closure as @longemen3000 shows above. You can input parameters in NLSolvers.jl https://github.com/JuliaNLSolvers/NLSolvers.jl .
I want to define a residual function (resid) that includes the weights (sig) and the data (data), to minimize Chi square (chi_sqr). For example
Is there a way to pass
sig
ydata
through an argument in theoptim
function?