mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-05-14 19:43:41 +02:00
fix: prior fit routine adjusted to work with iminuit version >= 2
This commit is contained in:
parent
071d550d1d
commit
e213b37413
2 changed files with 5 additions and 3 deletions
|
@ -386,13 +386,15 @@ def _prior_fit(x, y, func, priors, silent=False, **kwargs):
|
||||||
if not silent:
|
if not silent:
|
||||||
print('Method: migrad')
|
print('Method: migrad')
|
||||||
|
|
||||||
m = iminuit.Minuit.from_array_func(chisqfunc, x0, error=np.asarray(x0) * 0.01, errordef=1, print_level=0)
|
m = iminuit.Minuit(chisqfunc, x0)
|
||||||
|
m.errordef = 1
|
||||||
|
m.print_level = 0
|
||||||
if 'tol' in kwargs:
|
if 'tol' in kwargs:
|
||||||
m.tol = kwargs.get('tol')
|
m.tol = kwargs.get('tol')
|
||||||
else:
|
else:
|
||||||
m.tol = 1e-4
|
m.tol = 1e-4
|
||||||
m.migrad()
|
m.migrad()
|
||||||
params = np.asarray(m.values.values())
|
params = np.asarray(m.values)
|
||||||
|
|
||||||
output.chisquare_by_dof = m.fval / len(x)
|
output.chisquare_by_dof = m.fval / len(x)
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -9,5 +9,5 @@ setup(name='pyerrors',
|
||||||
author_email='fabian.joswig@ed.ac.uk',
|
author_email='fabian.joswig@ed.ac.uk',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
python_requires='>=3.6.0',
|
python_requires='>=3.6.0',
|
||||||
install_requires=['numpy>=1.16', 'autograd>=1.2', 'numdifftools', 'matplotlib>=3.3', 'scipy', 'iminuit<2', 'h5py']
|
install_requires=['numpy>=1.16', 'autograd>=1.2', 'numdifftools', 'matplotlib>=3.3', 'scipy', 'iminuit>=2', 'h5py']
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue