-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in visualization #966
Comments
Thanks for reporting, that is indeed a bug. I will see how this can be fixed. A temporary workaround for you is # Minuit fit
p0 = np.array([2., 2., 0., -1., -1.5])
mFit = LeastSquares(x, y, ey, fitFun)
mFit.visualize = lambda x, *args: None
m = Minuit(mFit, p0) # pass starting values
m.migrad()
# m.hesse() |
Closes #966 `LeastSquares.model` can now be used to uniformly call models which accept parameter values and parameter arrays in the same way, as already indicated by the docstring.
If you want to fit a smooth function from numba_stats import bernstein
def model(x, p):
domain_of_polynomial = (-0.4, 0.4)
return bernstein.density(x, p, *domain_of_polynomial)
start = np.ones(4) # increase this to increase flexibility of Bernstein polynomial
m = Minuit(LeastSquares(x, y, ey, model), start)
m.limits = (0, None) # ensure positiveness
m.migrad() |
Yes I know :) |
I like splines, too :). Bernstein polynomials are a special case of splines. |
hi,
I went back to an old project. It used to work with the then-current version of iminuit. Sorry, cannnot remember the exact version. Now it crashes with iminuit 2.25 (python 3.11.5, Intel Mac.).
The fit actually works, and gives the exact same result now as it used to. I think the crash is in the visualization part, which I guess has been added since?
Here you can find my jupyter notebook, stripped down to the bare minimum (html and ipynb versions)
http://hep.ucsb.edu/people/claudio/minuit/
Thanks.
Claudio
PS is there a way to turn off the visualization?
The text was updated successfully, but these errors were encountered: