1 | initial version |
The data that you have hints at a singularity at x=1 with data points concentrated around there. And the model isn't particularly good. This makes the nonlinear fit numerically very unstable. Compare with this:
sage: data = <same as before>
sage: var('a,b,x')
(a, b, x)
sage: model=a*(1-x)^b
sage: fit = find_fit(data,model,variables=[x],initial_guess=(1,1)); fit
[a == 0.017034240977895455, b == 0.3870748290050979]
sage: point2d(data) + plot(model.subs(a=fit[0].rhs(), b=fit[1].rhs()), 0, 1)