“fit” can mean many things. Maybe start with GitHub - JuliaNLSolvers/LsqFit.jl: Simple curve fitting in Julia ? But that package cannot make use of the error_y_1 info, for that you could code your own objective and use Optim.jl to minimize this. Or use some Bayesian approach.