The next release of iminuit will feature a new Fit Result display.
- The new fit result display is less cluttered.
- It has a new field that warns if a parameter is fitted at a limit.
- ASCII tables were replaced with beautiful unicode tables.
- Errors are now easier to spot in text tables.
You can see old vs. new below. Please commment!
Old displays
!pip install iminuit==1.4.8
import iminuit
Collecting iminuit==1.4.8
Using cached iminuit-1.4.8-cp38-cp38-macosx_10_9_x86_64.whl (390 kB)
Requirement already satisfied: numpy>=1.11.3 in /usr/local/lib/python3.8/site-packages (from iminuit==1.4.8) (1.19.0)
Installing collected packages: iminuit
Attempting uninstall: iminuit
Found existing installation: iminuit 1.4.9
Uninstalling iminuit-1.4.9:
Successfully uninstalled iminuit-1.4.9
Successfully installed iminuit-1.4.8
Good fit
m = iminuit.Minuit(lambda a, b: a ** 2 + b ** 2 + 1, pedantic=False)
m.migrad()
FCN = 1 |
Ncalls = 19 (19 total) |
EDM = 0 (Goal: 0.0002) |
up = 1.0 |
Valid Min. |
Valid Param. |
Above EDM |
Reached call limit |
True |
True |
False |
False |
Hesse failed |
Has cov. |
Accurate |
Pos. def. |
Forced |
False |
True |
True |
True |
False |
|
Name |
Value |
Hesse Error |
Minos Error- |
Minos Error+ |
Limit- |
Limit+ |
Fixed |
0 |
a |
0 |
1 |
|
|
|
|
|
1 |
b |
0 |
1 |
|
|
|
|
|
m = iminuit.Minuit(lambda a, b: a ** 2 + b ** 2 + 1, pedantic=False)
print(m.migrad())
------------------------------------------------------------------
| FCN = 1 | Ncalls=19 (19 total) |
| EDM = 0 (Goal: 0.0002) | up = 1.0 |
------------------------------------------------------------------
| Valid Min. | Valid Param. | Above EDM | Reached call limit |
------------------------------------------------------------------
| True | True | False | False |
------------------------------------------------------------------
| Hesse failed | Has cov. | Accurate | Pos. def. | Forced |
------------------------------------------------------------------
| False | True | True | True | False |
------------------------------------------------------------------
------------------------------------------------------------------------------------------
| | Name | Value | Hesse Err | Minos Err- | Minos Err+ | Limit- | Limit+ | Fixed |
------------------------------------------------------------------------------------------
| 0 | a | 0 | 1 | | | | | |
| 1 | b | 0 | 1 | | | | | |
------------------------------------------------------------------------------------------
Bad fits
m = iminuit.Minuit(lambda x, y : 0, pedantic=False)
m.migrad()
FCN = 0 |
Ncalls = 20 (20 total) |
EDM = 0 (Goal: 0.0002) |
up = 1.0 |
Valid Min. |
Valid Param. |
Above EDM |
Reached call limit |
False |
True |
False |
False |
Hesse failed |
Has cov. |
Accurate |
Pos. def. |
Forced |
True |
True |
False |
False |
False |
|
Name |
Value |
Hesse Error |
Minos Error- |
Minos Error+ |
Limit- |
Limit+ |
Fixed |
0 |
x |
0 |
0 |
|
|
|
|
|
1 |
y |
0 |
0 |
|
|
|
|
|
m = iminuit.Minuit(lambda x, y : (x-y) ** 2, limit_x=(0, 1), pedantic=False)
m.migrad()
FCN = 8.015e-09 |
Ncalls = 31 (31 total) |
EDM = 8.01e-09 (Goal: 0.0002) |
up = 1.0 |
Valid Min. |
Valid Param. |
Above EDM |
Reached call limit |
True |
True |
False |
False |
Hesse failed |
Has cov. |
Accurate |
Pos. def. |
Forced |
False |
True |
False |
False |
True |
|
Name |
Value |
Hesse Error |
Minos Error- |
Minos Error+ |
Limit- |
Limit+ |
Fixed |
0 |
x |
0.3 |
0.8 |
|
|
0 |
1 |
|
1 |
y |
0 |
16 |
|
|
|
|
|
m = iminuit.Minuit(lambda x, y : (x-y) ** 2, limit_x=(0, 1), pedantic=False)
print(m.migrad())
------------------------------------------------------------------
| FCN = 8.015e-09 | Ncalls=31 (31 total) |
| EDM = 8.01e-09 (Goal: 0.0002) | up = 1.0 |
------------------------------------------------------------------
| Valid Min. | Valid Param. | Above EDM | Reached call limit |
------------------------------------------------------------------
| True | True | False | False |
------------------------------------------------------------------
| Hesse failed | Has cov. | Accurate | Pos. def. | Forced |
------------------------------------------------------------------
| False | True | False | False | True |
------------------------------------------------------------------
------------------------------------------------------------------------------------------
| | Name | Value | Hesse Err | Minos Err- | Minos Err+ | Limit- | Limit+ | Fixed |
------------------------------------------------------------------------------------------
| 0 | x | 0.3 | 0.8 | | | 0 | 1 | |
| 1 | y | 0 | 16 | | | | | |
------------------------------------------------------------------------------------------
New displays
This part requires a restart of the Jupyter kernel.
!pip install --upgrade ../iminuit
import iminuit
Processing /Users/hdembinski/Extern/iminuit
Requirement already satisfied, skipping upgrade: numpy>=1.11.3 in /usr/local/lib/python3.8/site-packages (from iminuit==1.4.9) (1.19.0)
Building wheels for collected packages: iminuit
Building wheel for iminuit (setup.py) ... done
Created wheel for iminuit: filename=iminuit-1.4.9-cp38-cp38-macosx_10_15_x86_64.whl size=384673 sha256=9ba56dcf93e21dc8844737e5caf597fa22c78cc05bb431ac1b8bc3ddeca07510
Stored in directory: /private/var/folders/tl/pv6mt7z17tz0stm1fjfg01cc0000gn/T/pip-ephem-wheel-cache-2v6nwkbn/wheels/e7/61/b4/0dd6b8fc20e6d6b170f3e0bd185533497f2fe08c4ae74cc799
Successfully built iminuit
Installing collected packages: iminuit
Attempting uninstall: iminuit
Found existing installation: iminuit 1.4.9
Uninstalling iminuit-1.4.9:
Successfully uninstalled iminuit-1.4.9
Successfully installed iminuit-1.4.9
Good fit
import iminuit
m = iminuit.Minuit(lambda a, b: a ** 2 + b ** 2 + 1, pedantic=False)
m.migrad()
FCN = 1 |
Ncalls = 19 (19 total) |
EDM = 0 (Goal: 0.0002) |
up = 1.0 |
Valid Minimum |
Valid Parameters |
No Parameters at limit |
Below EDM goal |
Below call limit |
Hesse ok |
Has Covariance |
Accurate |
Pos. def. |
Not forced |
|
Name |
Value |
Hesse Error |
Minos Error- |
Minos Error+ |
Limit- |
Limit+ |
Fixed |
0 |
a |
0 |
1 |
|
|
|
|
|
1 |
b |
0 |
1 |
|
|
|
|
|
m = iminuit.Minuit(lambda a, b: a ** 2 + b ** 2 + 1, pedantic=False)
print(m.migrad())
┌──────────────────────────────────┬──────────────────────────────────────┐
│ FCN = 1 │ Ncalls = 19 (19 total) │
│ EDM = 0 (Goal: 0.0002) │ up = 1.0 │
├───────────────┬──────────────────┼──────────────────────────────────────┤
│ Valid Minimum │ Valid Parameters │ No Parameters at limit │
├───────────────┴──────────────────┼──────────────────────────────────────┤
│ Below EDM goal │ Below call limit │
├───────────────┬──────────────────┼───────────┬─────────────┬────────────┤
│ Hesse ok │ Has Covariance │ Accurate │ Pos. def. │ Not forced │
└───────────────┴──────────────────┴───────────┴─────────────┴────────────┘
┌───┬──────┬───────────┬───────────┬────────────┬────────────┬─────────┬─────────┬───────┐
│ │ Name │ Value │ Hesse Err │ Minos Err- │ Minos Err+ │ Limit- │ Limit+ │ Fixed │
├───┼──────┼───────────┼───────────┼────────────┼────────────┼─────────┼─────────┼───────┤
│ 0 │ a │ 0 │ 1 │ │ │ │ │ │
│ 1 │ b │ 0 │ 1 │ │ │ │ │ │
└───┴──────┴───────────┴───────────┴────────────┴────────────┴─────────┴─────────┴───────┘
Bad fits
m = iminuit.Minuit(lambda x, y : 0, pedantic=False)
m.migrad()
FCN = 0 |
Ncalls = 20 (20 total) |
EDM = 0 (Goal: 0.0002) |
up = 1.0 |
INVALID Minimum |
Valid Parameters |
No Parameters at limit |
Below EDM goal |
Below call limit |
Hesse FAILED |
Has Covariance |
APPROXIMATE |
NOT pos. def. |
Not forced |
|
Name |
Value |
Hesse Error |
Minos Error- |
Minos Error+ |
Limit- |
Limit+ |
Fixed |
0 |
x |
0 |
0 |
|
|
|
|
|
1 |
y |
0 |
0 |
|
|
|
|
|
m = iminuit.Minuit(lambda x, y : (x-y) ** 2, limit_x=(0, 1), pedantic=False)
m.migrad()
FCN = 8.015e-09 |
Ncalls = 31 (31 total) |
EDM = 8.01e-09 (Goal: 0.0002) |
up = 1.0 |
Valid Minimum |
Valid Parameters |
SOME Parameters at limit |
Below EDM goal |
Below call limit |
Hesse ok |
Has Covariance |
APPROXIMATE |
NOT pos. def. |
FORCED |
|
Name |
Value |
Hesse Error |
Minos Error- |
Minos Error+ |
Limit- |
Limit+ |
Fixed |
0 |
x |
0.3 |
0.8 |
|
|
0 |
1 |
|
1 |
y |
0 |
16 |
|
|
|
|
|
m = iminuit.Minuit(lambda x, y : (x-y) ** 2, limit_x=(0, 1), pedantic=False)
print(m.migrad())
┌──────────────────────────────────┬──────────────────────────────────────┐
│ FCN = 8.015e-09 │ Ncalls = 31 (31 total) │
│ EDM = 8.01e-09 (Goal: 0.0002) │ up = 1.0 │
├───────────────┬──────────────────┼──────────────────────────────────────┤
│ Valid Minimum │ Valid Parameters │ SOME Parameters at limit │
├───────────────┴──────────────────┼──────────────────────────────────────┤
│ Below EDM goal │ Below call limit │
├───────────────┬──────────────────┼───────────┬─────────────┬────────────┤
│ Hesse ok │ Has Covariance │APPROXIMATE│NOT pos. def.│ FORCED │
└───────────────┴──────────────────┴───────────┴─────────────┴────────────┘
┌───┬──────┬───────────┬───────────┬────────────┬────────────┬─────────┬─────────┬───────┐
│ │ Name │ Value │ Hesse Err │ Minos Err- │ Minos Err+ │ Limit- │ Limit+ │ Fixed │
├───┼──────┼───────────┼───────────┼────────────┼────────────┼─────────┼─────────┼───────┤
│ 0 │ x │ 0.3 │ 0.8 │ │ │ 0 │ 1 │ │
│ 1 │ y │ 0 │ 16 │ │ │ │ │ │
└───┴──────┴───────────┴───────────┴────────────┴────────────┴─────────┴─────────┴───────┘