Closed fmu984 closed 8 years ago
Thank you very much for your bug report. So far oscillations were only observed when the Langaus function was used and the eta / sigma ration was too large (see issue: https://github.com/SiLab-Bonn/pyLandau/issues/1). To see this without convolution is weird. Can you tell me the fit results (mu, eta, A) so that I can try to reproduce the error?
Fixed by using more appropriate parameters. Indeed it is the Langau, not Landau.
That's the difficulty with convolution and and fitting that can create an oscillating solution. To make the fit more stable it is usually good to restrict the parameter range by setting bounds. This is possible with scipy with the bounds parameter:
curve_fit(func, xdata, ydata, bounds=(0, [3., 2., 1.]))
Dear David, according to your renaming I changed the imports in my python scripts to:
import pylandau
usingoptimize.curve_fit(pylandau.landau
results in a strange fit - anyway but not a landau. Please have a look at the red curve. The green is langau which looks fine.