Tutorial

The following pages show an example analysis with emgfit broken down into the essential steps. Many of the more advanced features of emgfit are left out or only briefly mentioned in passing, so feel free to explore the documentation further!

This tutorial was created in the Jupyter Notebook emgfit_tutorial.ipynb which can be found in the emgfit/emgfit/examples/tutorial/ directory of the emgfit distribution. Feel free to copy the tutorial folder to a different directory (outside of the emgfit/ directory!) and follow along with the tutorial by actually running the code. You can also use this notebook as a template for your own analyses (consider removing some of the explanations). It is recommended to use a separate notebook for each spectrum to be fitted. This enables you to go back to the notebook at any time and check on all the details of how the fits were performed.

emgfit is optimized to be run within Jupyter Notebooks. There is dozens of decent introductions to using Jupyter Notebooks, a nice overview can e.g. be found at https://realpython.com/jupyter-notebook-introduction/. Naturally, the first step of an analysis with emgfit is starting up your notebook server by running jupyter notebook in your command-line interface. This should automatically make the Jupyter interface pop up in a browser window. From there you can navigate to different directories and create a new notebook (new panel on the top right) or open an existing notebook (.ipynb files).

Import the package

Assuming you have setup emgfit following the installation instructions, the first step after launching your Jupyter Notebook will be importing the emgfit package:

[1]:
### Import fit package
import emgfit as emg
print("emgfit version:",emg.__version__)
emgfit version: 0.3.1

How to access the documentation

Before we actually start processing a spectrum it is important to know how to get access to emgfit’s documentation. There is multiple options for this:

  1. The html documentation can be viewed in any browser. It contains usage examples, detailed explanations of the crucial components and API docs with the different modules and all their methods. The search option and cross references enable quick and easy browsing for help.

  2. Once you have imported emgfit you can access the docs directly from the Jupyter Notebook:

    • print all available methods of e.g. the spectrum class by running dir(emg.spectrum)

    • print documentation of a method using help(), e.g. the docs of the add_peak method are printed by running help(emg.spectrum.add_peak) in a code cell

    • keyboard shortcuts can be even more convenient:

      • Use TAB to get suggestions for auto-completion of method and variable names

      • Place the cursor inside the brackets of a function/method and press SHIFT + TAB to have a window with the function/method documention pop up

      • Pressing the H key inside a Jupyter Notebook shows you all available keyboard shortcuts)

Import data

The following code imports the mass data and creates an emgfit spectrum object called spec. The input file must be a TXT or CSV-file with the bin centers and counts per bin as the respective columns (this is in line e.g. with the format of the hist export mode in the mass acquisition software MAc). From here on the analysis of the spectrum proceeds by calling the various methods on our spectrum object spec.

[2]:
### Import mass data, plot full spectrum and indicate chosen fit range
filename = "2019-09-13_004-_006 SUMMED High stats 62Ga"
skiprows = 38 # number of header rows to skip upon data import
m_start = 61.9243 # low-mass cut off
m_stop = 61.962 # high-mass cut off

spec = emg.spectrum(filename+'.txt',m_start,m_stop,skiprows=skiprows)
_images/emgfit_tutorial_5_0.png

Add peaks to the spectrum

This can be done with the automatic peak detection spectrum method) and/or by manually adding peaks (add_peak spectrum method). The plots shown below are (optional) outputs of the detect_peaks method and depicts the different stages of the automatic peak detection.

All information about the peaks associated with the spectrum are compiled in the peak properties table. The table’s left-most column shows the respective peak indeces. In all fits, the peaks’ x_pos will be used as the initial values for the peak position parameters mu (to be exact: mu marks the centroid of the underlying Gaussians).

[3]:
### Detect peaks and add them to spectrum object 'spec'
spec.detect_peaks() # automatic peak detection
#spec.add_peak(61.925,species='?') # manually add a peak at x_pos = 61.925u
#spec.remove_peak(peak_index=0) # manually remove the peak with index 0
_images/emgfit_tutorial_7_0.png
_images/emgfit_tutorial_7_1.png
_images/emgfit_tutorial_7_2.png
_images/emgfit_tutorial_7_3.png
Peak properties table after peak detection:
x_pos species comment m_AME m_AME_error extrapolated fit_model cost_func red_chi area area_error m_ion rel_stat_error rel_recal_error rel_peakshape_error rel_mass_error A atomic_ME_keV mass_error_keV m_dev_keV
0 61.927800 ? - None None False None None None None None None None None None None None None None None
1 61.932021 ? - None None False None None None None None None None None None None None None None None
2 61.934369 ? - None None False None None None None None None None None None None None None None None
3 61.943618 ? - None None False None None None None None None None None None None None None None None
4 61.946994 ? - None None False None None None None None None None None None None None None None None
5 61.949527 ? - None None False None None None None None None None None None None None None None None
6 61.956611 ? - None None False None None None None None None None None None None None None None None
7 61.958997 ? - None None False None None None None None None None None None None None None None None

Assign species to the peaks (optional)

Although this step is optional, it is highly recommended that it is not skipped. By assigning species labels to your peaks you do not only gain more overview over your spectrum, but also allow for literature values to be automatically fetched from the AME database and entered into the peak properties table. Once a species label has been assigned, you can refer to this peak not only via its index but also via the label.

The assign_species method allows to assign species identifications either to a single selected peak or to all peaks at once. Here the second option was used by passing a list of species labels to assign_species. The list must have the same length as the number of peaks associated with the spectrum object. If there are peaks whose labels should not be changed (e.g. unidentified peaks), simply insert None as a placeholder at the corresponding spots (as done for peaks 2 and 7 below). The syntax for species labels follows the :-notation. It is important not to forget to subtract the number of electrons corresponding to the ion’s charge state! Otherwise the analysis would mistakenly proceed with the atomic instead of the ionic mass. Note that currently only singly charged species are supported by emgfit. Tentative peak identifications can be indicated by adding a '?' to the end of the species string. In this case the literature values are not fetched. The user can also define custom literature values (e.g. to handle isomers or if there are recent measurements that have not entered the AME yet). For more details see the documentation of assign_species.

This is also a good point in time to add any comments to the peaks using the add_peak_comment method. These comments can be particularly helpful for post-processing in Excel since they are also written into the output file with the fit results (as is the entire peak properties table). More general comments that concern the entire spectrum can instead be added with the add_spectrum_comment method.

[4]:
### Assign species and add peak comments
spec.assign_species(['Ni62:-1e','Cu62:-1e?',None,'Ga62:-1e','Ti46:O16:-1e','Sc46:O16:-1e','Ca43:F19:-1e',None])
spec.add_peak_comment('Non-isobaric',peak_index=2)
spec.show_peak_properties() # check the changes by printing the peak properties table
Species of peak 0 assigned as Ni62:-1e
Species of peak 1 assigned as Cu62:-1e?
Species of peak 3 assigned as Ga62:-1e
Species of peak 4 assigned as Ti46:O16:-1e
Species of peak 5 assigned as Sc46:O16:-1e
Species of peak 6 assigned as Ca43:F19:-1e
Comment of peak 2 was changed to:  Non-isobaric
x_pos species comment m_AME m_AME_error extrapolated fit_model cost_func red_chi area area_error m_ion rel_stat_error rel_recal_error rel_peakshape_error rel_mass_error A atomic_ME_keV mass_error_keV m_dev_keV
0 61.927800 Ni62:-1e - 61.927796 0.000000 False None None None None None None None None None None 62 None None None
1 61.932021 Cu62:-1e? - nan nan False None None None None None None None None None None nan None None None
2 61.934369 ? Non-isobaric nan nan False None None None None None None None None None None nan None None None
3 61.943618 Ga62:-1e - 61.943641 0.000001 False None None None None None None None None None None 62 None None None
4 61.946994 Ti46:O16:-1e - 61.946993 0.000000 False None None None None None None None None None None 62 None None None
5 61.949527 Sc46:O16:-1e - 61.949534 0.000001 False None None None None None None None None None None 62 None None None
6 61.956611 Ca43:F19:-1e - 61.956621 0.000000 False None None None None None None None None None None 62 None None None
7 61.958997 ? - nan nan False None None None None None None None None None None nan None None None

Activate hiding of mass values for blind analysis (optional)

By adding peak indeces to the spectrum’s blinded_peaks list, the obtained masses and positions of selected peaks-of-interest can be hidden from the user. This blindfolding can avoid user bias and is automatically lifted once the results are exported.

[5]:
### Optionally turn on blinding of specific peaks of interest to enable blind analysis
spec.set_blinded_peaks([0,4]) # activate blinding for peaks 0 & 4
#spec.set_blinded_peaks([],overwrite=True) # run this to deactivate blinding for all peaks
Blinding is activated for peaks: 0, 4

Select the optimal fit model and perform the peak-shape calibration

Next we need to find both a fit model and a set of model parameters that capture the shape of our peaks as well as possible. In emgfit both of this is achieved with the determine_peak_shape method. Once the peak-shape calibration has been performed all subsequent fits will be performed with this fixed peak-shape, by only varying the peak centroids, amplitudes and optionally the uniform-baseline parameter bkg_c.

By default determine_peak_shape performs an automatic model selection in which the shape-calibrant peak is first fitted with a pure Gaussian and then with Hyper-EMG functions with an increasing number of expontential tails on the left and right. The algorithm selects the fit model which yields the smallest \(\chi^2_\text{red}\) without having any of the tail weight parameters \(\eta\) compatible with zero within their uncertainty. Alternatively, the auto-model selection can be turned off with the argument vary_tail_order=False and the fit model can be selected manually with the fit_model argument.

Once the best fit model has been selected the method proceeds with the determination of the peak-shape parameters and shows a detailed report with the fit results.

Some recommendations:

  • It is recommended to do the peak-shape calibration with a chi-squared fit (default) since this yields more robust results and more trusworthy parameter uncertainty estimates. Check the method docs for info on performing the shape calibration with binned maximum likelihood estimation.

  • Ideally the peak-shape calibration is performed on a well-separated peak with high statistics. In this example, the Ca43:F19:-1e peak was selected as peak-shape calibrant. Since the default fit range includes a smaller peak on the right, the range was manually reduced to 0.45u with the x_fit_range argument. If unavoidable, the peak-shape determination can also be performed on partially overlapping peaks since emgfit ensures identical shape parameters for all peaks being fitted.

[6]:
## Peak-shape calibration with default settings, including automatic model selection:
#spec.determine_peak_shape(species_shape_calib='Ca43:F19:-1e')

## Peak-shape calibration with user-defined fit range:
spec.determine_peak_shape(species_shape_calib='Ca43:F19:-1e',x_fit_range=0.0045)

## Peak-shape calibration with user-defined fit model:
#spec.determine_peak_shape(species_shape_calib='Ca43:F19:-1e',fit_model='emg12',vary_tail_order=False)

##### Determine optimal tail order #####


### Fitting data with Gaussian ###---------------------------------------------------------------------------------------------

_images/emgfit_tutorial_13_1.png
_images/emgfit_tutorial_13_2.png

Gaussian-fit yields reduced chi-square of: 45.57 +- 0.13


### Fitting data with emg01 ###---------------------------------------------------------------------------------------------

_images/emgfit_tutorial_13_4.png
_images/emgfit_tutorial_13_5.png

emg01-fit yields reduced chi-square of: 13.79 +- 0.13


### Fitting data with emg10 ###---------------------------------------------------------------------------------------------

_images/emgfit_tutorial_13_7.png
_images/emgfit_tutorial_13_8.png

emg10-fit yields reduced chi-square of: 45.96 +- 0.13


### Fitting data with emg11 ###---------------------------------------------------------------------------------------------

_images/emgfit_tutorial_13_10.png
_images/emgfit_tutorial_13_11.png

emg11-fit yields reduced chi-square of: 2.6 +- 0.13


### Fitting data with emg12 ###---------------------------------------------------------------------------------------------

_images/emgfit_tutorial_13_13.png
_images/emgfit_tutorial_13_14.png

emg12-fit yields reduced chi-square of: 1.22 +- 0.13


### Fitting data with emg21 ###---------------------------------------------------------------------------------------------

_images/emgfit_tutorial_13_16.png
_images/emgfit_tutorial_13_17.png
WARNING: p6_tau_m1  = 3.2e-06 +- 7.6e-04 is compatible with zero within uncertainty.
WARNING: p6_eta_m2  = 0.100 +- 0.462 is compatible with zero within uncertainty.
             This tail order is likely overfitting the data and will be excluded from selection.

emg21-fit yields reduced chi-square of: 1.47 +- 0.13


### Fitting data with emg22 ###---------------------------------------------------------------------------------------------

_images/emgfit_tutorial_13_19.png
_images/emgfit_tutorial_13_20.png

emg22-fit yields reduced chi-square of: 0.96 +- 0.13


### Fitting data with emg23 ###---------------------------------------------------------------------------------------------

_images/emgfit_tutorial_13_22.png
_images/emgfit_tutorial_13_23.png
WARNING: p6_eta_m1  = 0.891 +- 2.051 is compatible with zero within uncertainty.
WARNING: p6_eta_m2  = 0.109 +- 2.051 is compatible with zero within uncertainty.
WARNING: p6_eta_p1  = 0.443 +- 6.166 is compatible with zero within uncertainty.
WARNING: p6_tau_p1  = 3.2e-05 +- 4.0e-05 is compatible with zero within uncertainty.
WARNING: p6_eta_p2  = 0.458 +- 4.587 is compatible with zero within uncertainty.
WARNING: p6_eta_p3  = 0.099 +- 6.166 is compatible with zero within uncertainty.
             This tail order is likely overfitting the data and will be excluded from selection.

emg23-fit yields reduced chi-square of: 0.98 +- 0.13


### Fitting data with emg32 ###---------------------------------------------------------------------------------------------

_images/emgfit_tutorial_13_25.png
_images/emgfit_tutorial_13_26.png
WARNING: p6_tau_m2  = 1.5e-04 +- 1.7e-04 is compatible with zero within uncertainty.
WARNING: p6_eta_m3  = 0.007 +- 0.100 is compatible with zero within uncertainty.
WARNING: p6_tau_m3  = 3.2e-04 +- 1.6e-03 is compatible with zero within uncertainty.
             This tail order is likely overfitting the data and will be excluded from selection.

emg32-fit yields reduced chi-square of: 0.98 +- 0.13


### Fitting data with emg33 ###---------------------------------------------------------------------------------------------

_images/emgfit_tutorial_13_28.png
_images/emgfit_tutorial_13_29.png
WARNING: p6_eta_m1  = 0.872 +- 3.743 is compatible with zero within uncertainty.
WARNING: p6_eta_m2  = 0.120 +- 3.483 is compatible with zero within uncertainty.
WARNING: p6_tau_m2  = 1.6e-04 +- 2.2e-04 is compatible with zero within uncertainty.
WARNING: p6_eta_m3  = 0.009 +- 3.743 is compatible with zero within uncertainty.
WARNING: p6_tau_m3  = 3.5e-04 +- 2.4e-03 is compatible with zero within uncertainty.
WARNING: p6_eta_p1  = 0.444 +- 10.412 is compatible with zero within uncertainty.
WARNING: p6_tau_p1  = 3.1e-05 +- 4.0e-05 is compatible with zero within uncertainty.
WARNING: p6_eta_p2  = 0.460 +- 7.852 is compatible with zero within uncertainty.
WARNING: p6_eta_p3  = 0.096 +- 10.412 is compatible with zero within uncertainty.
             This tail order is likely overfitting the data and will be excluded from selection.

emg33-fit yields reduced chi-square of: 0.99 +- 0.14


##### RESULT OF AUTOMATIC MODEL SELECTION: #####

    Best fit model determined to be:  emg22
    Corresponding chi²-reduced:  0.96 +- 0.13


##### Peak-shape determination #####-------------------------------------------------------------------------------------------
_images/emgfit_tutorial_13_31.png
_images/emgfit_tutorial_13_32.png

Model

(Model(constant, prefix='bkg_') + Model(emg22, prefix='p6_'))

Fit Statistics

fitting methodleast_squares
# function evals14
# data points123
# variables11
chi-square 107.821079
reduced chi-square 0.96268820
Akaike info crit. 5.79952458
Bayesian info crit. 36.7335525

Variables

name value standard error relative error initial value min max vary expression
bkg_c 0.93747173 0.21447703 (22.88%) 0.1 0.00000000 4.00000000 True
p6_amp 0.95184921 0.00599044 (0.63%) 0.8422080000000001 1.0000e-20 inf True
p6_mu 61.9566396 4.0323e-06 (0.00%) 61.95661076349748 61.9559912 61.9572303 True
p6_sigma 8.3414e-05 2.9557e-06 (3.54%) 8.68e-05 0.00000000 0.00508680 True
p6_theta 0.72471371 0.02349106 (3.24%) 0.5 0.00000000 1.00000000 True
p6_eta_m1 0.92018998 0.02313098 (2.51%) 0.85 0.00000000 1.00000000 True
p6_eta_m2 0.07981002 0.02313098 (28.98%) 0.15000000000000002 0.00000000 1.00000000 False 1-p6_eta_m1
p6_tau_m1 4.4900e-05 5.8778e-06 (13.09%) 3.1e-05 1.0000e-12 0.05000000 True
p6_tau_m2 1.7683e-04 2.4816e-05 (14.03%) 0.00031 1.0000e-12 0.05000000 True
p6_eta_p1 0.79009146 0.04493310 (5.69%) 0.85 0.00000000 1.00000000 True
p6_eta_p2 0.20990854 0.04493310 (21.41%) 0.15000000000000002 0.00000000 1.00000000 False 1-p6_eta_p1
p6_tau_p1 1.2412e-04 1.3320e-05 (10.73%) 3.1e-05 1.0000e-12 0.05000000 True
p6_tau_p2 4.0762e-04 5.4795e-05 (13.44%) 0.000372 1.0000e-12 0.05000000 True

Correlations (unreported correlations are < 0.100)

p6_eta_m1p6_tau_m20.9505
p6_eta_p1p6_tau_p20.9227
p6_thetap6_tau_p10.8417
p6_sigmap6_tau_m1-0.8158
p6_eta_m1p6_tau_m10.7745
p6_tau_p1p6_tau_p20.7729
p6_eta_p1p6_tau_p10.7297
p6_tau_m1p6_tau_m20.7147
p6_mup6_tau_m10.7090
p6_mup6_eta_m10.6226
p6_sigmap6_theta0.6097
p6_mup6_tau_m20.5369
p6_sigmap6_tau_p10.5313
p6_mup6_theta0.5166
p6_thetap6_tau_p20.4898
bkg_cp6_tau_m2-0.4616
p6_sigmap6_eta_m1-0.4114
bkg_cp6_tau_p2-0.4083
p6_sigmap6_tau_m2-0.4033
bkg_cp6_eta_m1-0.3728
p6_mup6_tau_p10.3425
p6_thetap6_eta_p10.3425
p6_mup6_sigma-0.2865
bkg_cp6_eta_p1-0.2755
p6_mup6_tau_p20.2750
p6_tau_m1p6_tau_p1-0.2464
p6_sigmap6_tau_p20.2342
bkg_cp6_mu-0.2259
bkg_cp6_tau_m1-0.2253
p6_thetap6_tau_m1-0.1926
p6_mup6_eta_p10.1783
bkg_cp6_tau_p1-0.1740
bkg_cp6_amp-0.1418
p6_tau_m2p6_tau_p20.1390
p6_sigmap6_eta_p10.1320
p6_eta_m1p6_tau_p20.1272

Determine A_stat_emg for subsequent stat. error estimations (optional)

By default, the statistical uncertainties of Hyper-EMG fits are estimated using the equation:

\(\sigma_{stat} = A_{stat,emg} \cdot \frac{\mathrm{FWHM}}{\sqrt{N_{counts}}}\)

where \(\mathrm{FWHM}\) and \(N_{counts}\) refer to the full width at half maximum and the number of counts in the respective peak. If the statistical uncertainties are estimated using the `get_errors_from_resampling <modules.rst#emgfit.spectrum.spectrum.determine_A_stat_emg>`__ method (see ” Perform parametric bootstrap to get refined statistical uncertainties” section below) this step can be skipped.

By default a of value \(A_{stat,emg} = 0.52\) will be used for Hyper-EMG models (for Gaussians \(A_{stat,G}=0.425\)).

However, \(A_{stat,emg}\) depends on the peak-shape and can deviate from the default value. Therefore, the determine_A_stat_emg method can be used to estimate \(A_{stat,emg}\) for the specific peak shape in the spectrum. This is done by fitting many simulated spectra created via bootstrap re-sampling from a reference peak in the spectrum. The reference peak should be well-separated and have decent statistics (e.g. the peak-shape calibrant). For details on how \(A_{stat,emg}\) is estimated see the linked docs of determine_A_stat_emg.

This method will typically run for ~10 minutes if N_spectra=1000 (default) is used. For demonstration purposes here the number of bootstrapped spectra generated for each data point (N_spectra argument) was reduced to 10 to get a quicker run time. This is also the reason for the large scatter of the data points below.

In practice it is convenient to skip this method for the first processing of the spectrum since this will only affect the statistical uncertainties but no other fit properties. Once reasonable fits have been achieved for all peaks of interest in the cells below, the exact uncertainties can be obtained by returning to this cell to execute determine_A_stat_emg with a decent value for N_spectra and then re-runnning the cells below (then with the update value for determine_A_stat_emg). The latter is conveniently done by using the Run All Below option in the Cell panel of the Jupyter Notebook.

[7]:
# Determine A_stat_emg and save the resulting plot
# In actual practice N_spectra >= 1000 should be used
spec.determine_A_stat_emg(species='Ca43:F19:-1e',x_range=0.004,plot_filename='outputs/'+filename+'_MLE',N_spectra=10)
Creating synthetic spectra via bootstrap re-sampling and fitting them for A_stat determination.
Depending on the choice of `N_spectra` this can take a few minutes. Interrupt kernel if this takes too long.

Done!

[[Model]]
    Model(powerlaw)
[[Fit Statistics]]
    # fitting method   = leastsq
    # function evals   = 5
    # data points      = 8
    # variables        = 1
    chi-square         = 9.8226e-09
    reduced chi-square = 1.4032e-09
    Akaike info crit   = -162.144192
    Bayesian info crit = -162.064750
[[Variables]]
    amplitude:  1.3272e-04 +/- 1.3233e-05 (9.97%) (init = 1)
    exponent:  -0.5 (fixed)
_images/emgfit_tutorial_15_3.png
A_stat of a Gaussian model: 0.425
Default A_stat_emg for Hyper-EMG models: 0.52
A_stat_emg for this spectrum's emg22 fit model: 0.554 +- 0.056

Fit all peaks, perform mass re-calibration & obtain final mass values

The following code fits all peaks in the spectrum, performs the mass (re-)calibration, determines the peak-shape uncertainties and updates the peak properties list with the results including the final mass values and their uncertainties.

The simultaneous mass recalibration is optional and only invoked when the species_mass_calib (or the index_mass_calib) argument are specified. If this feature is not used, the fit_peaks method requires a pre-existing mass calibration (see Alternative 1 section below). In contrast to determine_peak_shape, by default fit_peaks performs a binned maximum likelihood fit (‘MLE’). For chi-square fitting with fit_peaks see Alternative 2 section below. Fits with fit_peaks can be restricted to a user-defined mass range or to groups of neighbouring peaks selected by index (see the commented-out lines below).

[8]:
# Maximum likelihood fit of all peaks in the spectrum
spec.fit_peaks(species_mass_calib='Ti46:O16:-1e')

# Maximum likelihood fit of peaks in a user-defined mass range
#spec.fit_peaks(species_mass_calib='Ti46:O16:-1e',x_fit_cen=61.9455,x_fit_range=0.01)

# Maximum likelihood fit of peaks specified by index
#spec.fit_peaks(species_mass_calib='Ti46:O16:-1e',peak_indeces=[3,4,5])
_images/emgfit_tutorial_17_0.png
_images/emgfit_tutorial_17_1.png

##### Mass recalibration #####

Relative literature error of mass calibrant:     2.8e-09
Relative statistical error of mass calibrant:    1.2e-08

Recalibration factor:    0.999999711 = 1 -2.9e-07
Relative recalibration error:    1.2e-08


##### Peak-shape uncertainty evaluation #####

Determining absolute centroid shifts of mass calibrant.

All mass shifts below are corrected for the corresponding shifts of the mass calibrant peak.

Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  0 by  -0.16  /   0.22 μu  & its area by   0.1 /  -0.1 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  1 by   0.43  /  -0.45 μu  & its area by   0.2 /  -0.1 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  2 by  -0.24  /   0.33 μu  & its area by   0.4 /  -0.1 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  3 by  -0.04  /  -0.00 μu  & its area by   0.4 /  -0.2 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  5 by  -0.04  /  -0.02 μu  & its area by   0.6 /  -0.6 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  6 by  -0.00  /  -0.03 μu  & its area by   0.4 /  -0.3 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  7 by  -0.21  /  -0.14 μu  & its area by   0.2 /  -0.2 counts.

Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  0 by  -0.55  /   0.43 μu  & its area by  -0.2 /   0.2 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  1 by  -1.10  /   0.97 μu  & its area by  -0.4 /   0.3 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  2 by  -0.42  /   0.29 μu  & its area by  -0.7 /   0.6 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  3 by  -0.25  /   0.07 μu  & its area by  -0.9 /   0.8 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  5 by  -0.28  /   0.19 μu  & its area by  -0.2 /   0.1 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  6 by  -0.14  /   0.01 μu  & its area by  -2.4 /   2.1 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  7 by  -1.91  /   1.76 μu  & its area by   0.2 /  -0.2 counts.

Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  0 by   0.68  /  -0.61 μu  & its area by  -0.4 /   0.3 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  1 by   0.30  /  -0.30 μu  & its area by  -0.4 /   0.3 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  2 by   0.39  /  -0.40 μu  & its area by  -1.9 /   1.3 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  3 by   0.29  /  -0.27 μu  & its area by  -1.0 /   0.7 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  5 by   0.23  /  -0.23 μu  & its area by  -3.9 /   3.0 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  6 by   0.01  /  -0.10 μu  & its area by  -4.4 /   2.8 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  7 by   0.48  /  -0.51 μu  & its area by  -0.4 /   0.4 counts.

Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  0 by  -0.76  /   0.78 μu  & its area by   0.2 /  -0.1 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  1 by   0.18  /  -0.32 μu  & its area by   0.2 /  -0.2 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  2 by  -0.34  /   0.48 μu  & its area by   0.5 /  -0.2 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  3 by  -0.13  /   0.08 μu  & its area by   0.4 /  -0.3 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  5 by  -0.18  /   0.09 μu  & its area by   1.0 /  -0.5 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  6 by  -0.02  /  -0.01 μu  & its area by   5.5 /  -0.5 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  7 by  -1.06  /   0.74 μu  & its area by   0.2 /  -0.2 counts.

Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  0 by  -0.21  /   0.37 μu  & its area by   0.3 /  -0.4 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  1 by  -0.19  /   0.00 μu  & its area by   0.3 /  -0.5 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  2 by  -0.16  /   0.28 μu  & its area by   1.0 /  -2.3 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  3 by  -0.15  /   0.19 μu  & its area by   0.6 /  -1.1 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  5 by  -0.08  /   0.06 μu  & its area by   3.0 /  -3.8 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  6 by   0.01  /  -0.01 μu  & its area by   9.6 /  -7.7 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  7 by  -0.18  /  -0.23 μu  & its area by   0.3 /  -0.5 counts.

Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  0 by  -0.05  /   0.09 μu  & its area by  -0.3 /   0.3 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  1 by  -0.33  /   0.11 μu  & its area by  -0.5 /   0.5 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  2 by  -0.13  /   0.23 μu  & its area by  -1.7 /   1.6 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  3 by  -0.06  /   0.10 μu  & its area by  -2.1 /   1.7 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  5 by  -0.28  /   0.15 μu  & its area by   0.3 /  -0.7 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  6 by   0.02  /  -0.05 μu  & its area by  -6.5 /   5.1 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  7 by  -4.18  /   2.98 μu  & its area by   1.0 /  -1.0 counts.

Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  0 by   0.14  /  -0.16 μu  & its area by   0.2 /  -0.1 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  1 by   0.31  /  -0.59 μu  & its area by   0.3 /  -0.3 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  2 by   0.41  /  -0.47 μu  & its area by   0.6 /  -0.5 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  3 by   0.16  /  -0.23 μu  & its area by   0.6 /  -0.8 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  5 by   0.01  /  -0.07 μu  & its area by   1.1 /  -1.2 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  6 by  -0.01  /  -0.08 μu  & its area by   7.1 /   0.1 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  7 by   0.27  /  -0.54 μu  & its area by   0.3 /  -0.4 counts.

Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  0 by  -0.05  /   0.00 μu  & its area by   0.4 /  -0.5 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  1 by   0.30  /  -0.39 μu  & its area by   0.5 /  -0.6 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  2 by   0.01  /  -0.08 μu  & its area by   2.8 /  -3.0 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  3 by   0.02  /  -0.07 μu  & its area by   2.4 /  -2.7 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  5 by   0.41  /  -0.50 μu  & its area by  -7.8 /   5.2 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  6 by  -0.04  /   0.03 μu  & its area by  11.6 / -12.6 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  7 by   4.43  /  -8.63 μu  & its area by  -4.4 /   3.5 counts.

Relative peak-shape error of peak  0:  2.0e-08
Relative peak-shape error of peak  1:  2.4e-08
Relative peak-shape error of peak  2:  1.6e-08
Relative peak-shape error of peak  3:  8.3e-09
Relative peak-shape error of peak  5:  1.1e-08
Relative peak-shape error of peak  6:  3.3e-09
Relative peak-shape error of peak  7:  1.6e-07
x_pos species comment m_AME m_AME_error extrapolated fit_model cost_func red_chi area area_error m_ion rel_stat_error rel_recal_error rel_peakshape_error rel_mass_error A atomic_ME_keV mass_error_keV m_dev_keV
0 61.927800 Ni62:-1e - 61.927796 0.000000 False emg22 MLE 1.21 38.34 6.81 blinded 3.46e-07 1.20e-08 2.04e-08 3.47e-07 62 blinded 20.01 blinded
1 61.932021 Cu62:-1e? - nan nan False emg22 MLE 1.21 27.65 6.07 61.932051 4.08e-07 1.20e-08 2.42e-08 4.08e-07 nan nan 23.56 nan
2 61.934369 ? Non-isobaric nan nan False emg22 MLE 1.21 3870.51 62.70 61.934369 3.44e-08 1.20e-08 1.64e-08 4.00e-08 nan nan 2.31 nan
3 61.943618 Ga62:-1e - 61.943641 0.000001 False emg22 MLE 1.21 953.66 31.43 61.943636 6.94e-08 1.20e-08 8.34e-09 7.09e-08 62 -51992.04 4.09 -5.12
4 61.946994 Ti46:O16:-1e mass calibrant 61.946993 0.000000 False emg22 MLE 1.21 33993.44 185.05 blinded 1.16e-08 1.20e-08 nan nan 62 blinded nan blinded
5 61.949527 Sc46:O16:-1e - 61.949534 0.000001 False emg22 MLE 1.21 1572.09 41.25 61.949540 5.40e-08 1.20e-08 1.14e-08 5.65e-08 62 -46492.38 3.26 5.84
6 61.956611 Ca43:F19:-1e shape calibrant 61.956621 0.000000 False emg22 MLE 1.21 25957.02 162.50 61.956622 1.33e-08 1.20e-08 3.30e-09 1.82e-08 62 -39895.65 1.05 0.62
7 61.958997 ? - nan nan False emg22 MLE 1.21 27.79 7.94 61.959017 4.06e-07 1.20e-08 1.59e-07 4.37e-07 nan nan 25.20 nan
The values for chi-squared as well as the parameter uncertainties and correlations reported by lmfit below should be taken with caution when your MLE fit includes bins with low statistics. For details see Notes section in the spectrum.peakfit() method documentation.

Model

((((((((Model(constant, prefix='bkg_') + Model(emg22, prefix='p0_')) + Model(emg22, prefix='p1_')) + Model(emg22, prefix='p2_')) + Model(emg22, prefix='p3_')) + Model(emg22, prefix='p4_')) + Model(emg22, prefix='p5_')) + Model(emg22, prefix='p6_')) + Model(emg22, prefix='p7_'))

Fit Statistics

fitting methodleast_squares
# function evals11
# data points1027
# variables17
chi-square 1222.57926
reduced chi-square 1.21047452
Akaike info crit. 213.027510
Bayesian info crit. 296.912263

Variables

name value standard error relative error initial value min max vary expression
bkg_c 0.27789812 0.02354870 (8.47%) 0.1 0.00000000 4.00000000 True
p0_amp 0.00140702 2.4803e-04 (17.63%) 0.001488 1.0000e-20 inf True
p0_mu nan 2.3155e-05 (nan%) 61.927800309876424 61.9271810 61.9284196 True
p0_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p0_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p0_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p0_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p0_eta_m1
p0_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p0_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p0_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p0_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p0_eta_p1
p0_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p0_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p1_amp 0.00101479 2.1873e-04 (21.55%) 0.000496 1.0000e-20 inf True
p1_mu 61.9320684 2.7578e-05 (0.00%) 61.93202053070152 61.9314012 61.9326399 True
p1_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p1_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p1_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p1_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p1_eta_m1
p1_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p1_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p1_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p1_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p1_eta_p1
p1_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p1_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p2_amp 0.14203203 0.00229478 (1.62%) 0.15648800000000002 1.0000e-20 inf True
p2_mu 61.9343873 2.0506e-06 (0.00%) 61.93436923761443 61.9337499 61.9349886 True
p2_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p2_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p2_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p2_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p2_eta_m1
p2_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p2_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p2_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p2_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p2_eta_p1
p2_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p2_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p3_amp 0.03499553 0.00114428 (3.27%) 0.031992 1.0000e-20 inf True
p3_mu 61.9436536 4.0801e-06 (0.00%) 61.943617703998214 61.9429983 61.9442371 True
p3_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p3_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p3_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p3_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p3_eta_m1
p3_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p3_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p3_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p3_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p3_eta_p1
p3_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p3_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p4_amp 1.24742061 0.00679048 (0.54%) 1.0294480000000001 1.0000e-20 inf True
p4_mu nan 7.0521e-07 (nan%) 61.946994300285866 61.9463748 61.9476138 True
p4_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p4_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p4_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p4_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p4_eta_m1
p4_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p4_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p4_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p4_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p4_eta_p1
p4_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p4_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p5_amp 0.05768914 0.00147153 (2.55%) 0.050095999999999995 1.0000e-20 inf True
p5_mu 61.9495577 3.1823e-06 (0.00%) 61.94952680789496 61.9489073 61.9501463 True
p5_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p5_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p5_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p5_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p5_eta_m1
p5_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p5_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p5_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p5_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p5_eta_p1
p5_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p5_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p6_amp 0.95251660 0.00591791 (0.62%) 0.8422080000000001 1.0000e-20 inf True
p6_mu 61.9566396 7.7843e-07 (0.00%) 61.95661076349748 61.9559912 61.9572303 True
p6_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p6_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p6_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p6_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p6_eta_m1
p6_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p6_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p6_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p6_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p6_eta_p1
p6_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p6_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p7_amp 0.00101970 2.3618e-04 (23.16%) 0.001488 1.0000e-20 inf True
p7_mu 61.9590345 3.1347e-05 (0.00%) 61.95899664282278 61.9583771 61.9596162 True
p7_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p7_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p7_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p7_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p7_eta_m1
p7_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p7_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p7_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p7_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p7_eta_p1
p7_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p7_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False

Plot the fit curve zoomed to a region of interest (optional)

For more detailed inspection of the fit, a zoom to peaks or regions of interest can be shown with the plot_fit_zoom method.

[9]:
spec.plot_fit_zoom(peak_indeces=[3,4]) # zoom to region around peaks 3 and 4
_images/emgfit_tutorial_19_0.png
_images/emgfit_tutorial_19_1.png

Perform parametric bootstrap to get refined statistical uncertainties (optional)

The A_stat_emg determination with determine_A_stat_emg relies on fits of bootstrapped subspectra of a single reference peak. The obtained A_stat_emg factor is then used to estimate the statistical uncertainties of all peaks.

As an alternative, the statistical uncertainty can be estimated for each peak individually using the get_errors_from_resampling method. In this method synthetic spectra are created for all peaks of interest by resampling events from the best-fit curve (“parametric bootstrap”). As opposed to the non-parametric bootstrap of determine_A_stat_emg, this technique is also applicable to low statistics peaks (assuming that the fit model describes the data well). The fits of the peaks of interest are re-performed using a large number of synthetic spectra (by default: N_spectra=1000) and the statistical mass and area uncertainties are estimated using the standard deviations of the obtained fit results. Finally, the original statistical mass and area uncertainties in the peak properties table are overwritten with the new values.

[10]:
# NOTE: For quicker run time in this demo, the number of synthetic spectra to fit `N_spectra` was manually reduced.
# For reliable results run this method with at least the default value of N_spectra=1000
# Further, parallel processing was turned off by setting the `n_cores` argument to 1.

spec.get_errors_from_resampling(N_spectra=20, n_cores=1) # arguments adapted for demonstration
#spec.get_errors_from_resampling() # typical execution with default arguments and all available cores
Fitting 20 simulated spectra to determine statistical mass and peak area errors.

Updated the statistical and peak area uncertainties of peak(s) 0, 1, 2, 3, 4, 5, 6, 7.

Re-calculated mass recalibration error from updated statistical uncertainty of mass calibrant.
Updated total mass errors of peaks 0, 1, 2, 3, 5, 6, 7.

Updated peak properties table:
x_pos species comment m_AME m_AME_error extrapolated fit_model cost_func red_chi area area_error m_ion rel_stat_error rel_recal_error rel_peakshape_error rel_mass_error A atomic_ME_keV mass_error_keV m_dev_keV
0 61.927800 Ni62:-1e - 61.927796 0.000000 False emg22 MLE 1.21 38.34 7.00 blinded 3.48e-07 1.16e-08 2.04e-08 3.49e-07 62 blinded 20.13 blinded
1 61.932021 Cu62:-1e? - nan nan False emg22 MLE 1.21 27.65 6.09 61.932051 2.84e-07 1.16e-08 2.42e-08 2.85e-07 nan nan 16.46 nan
2 61.934369 ? Non-isobaric nan nan False emg22 MLE 1.21 3870.51 64.40 61.934369 3.40e-08 1.16e-08 1.64e-08 3.95e-08 nan nan 2.28 nan
3 61.943618 Ga62:-1e - 61.943641 0.000001 False emg22 MLE 1.21 953.66 33.66 61.943636 6.62e-08 1.16e-08 8.34e-09 6.77e-08 62 -51992.04 3.91 -5.12
4 61.946994 Ti46:O16:-1e mass calibrant 61.946993 0.000000 False emg22 MLE 1.21 33993.44 142.82 blinded 1.12e-08 1.16e-08 nan nan 62 blinded nan blinded
5 61.949527 Sc46:O16:-1e - 61.949534 0.000001 False emg22 MLE 1.21 1572.09 39.91 61.949540 5.10e-08 1.16e-08 1.14e-08 5.35e-08 62 -46492.38 3.09 5.84
6 61.956611 Ca43:F19:-1e shape calibrant 61.956621 0.000000 False emg22 MLE 1.21 25957.02 128.37 61.956622 1.19e-08 1.16e-08 3.30e-09 1.69e-08 62 -39895.65 0.98 0.62
7 61.958997 ? - nan nan False emg22 MLE 1.21 27.79 8.45 61.959017 4.16e-07 1.16e-08 1.59e-07 4.46e-07 nan nan 25.72 nan
         stat. errors from resampling

Get refined peak-shape uncertainties using MCMC parameter samples (optional)

The simple peak-shape error estimation in fit_peaks() relies on some simplifying assumptions: 1. The posterior distributions of the shape parameters follow normal distributions. 2. The shape parameters are uncorrelated.

In many cases, at least one of those assumptions is violated. Therefore, a refined way of estimating the peak-shape uncertainties has been added to emgfit: get_MC_peakshape_errors. This method uses Markov-Chain Monte Carlo (MCMC) sampling to estimate the posterior distributions of the shape parameters. The sampling results are compiled in a corner plot/”covariance map” which includes both 1D-histograms of the parameter posteriors and 2D-histograms of the parameter correlations. By randomly drawing shape parameters sets from the obtained MCMC samples one obtains a representation of all peak shapes supported by the data. The calibrant and the peaks of interest are then re-fitted with all drawn shape parameter sets. Refined peak-shape uncertainties are obtained from the RMS deviation of the resulting mass values and peak areas from the best-fit values obtained with fit_peaks. Usually, accounting for parameter correlations results in significantly smaller peak-shape errors.

The MCMC sampling can also already be performed during the peak-shape calibration using the map_par_covar option of determine_peak_shape. The corner plot of the parameter covariances can be used to assess whether get_MC_peakshape_errors should be run. For more details on the MC peak-shape uncertainty estimation see docs of get_MC_peakshape_errors.

[11]:
# NOTE: For quicker run time in this demo, the length of the sampling chain, the thinning interval and the number
# of shape parameter sets to perform fits with were manually reduced with the `steps`, `thin` and
# `N_samples` arguments, respectively. This triggers a warning about the insufficient MCMC chain length.
# For reasonable results those parameters should be increased to at least their default values.
# For this specific data decent results are obtained using the following: steps = 16000, thin = 280, N_samples = 1000
# Further, parallel processing was turned off by setting the `n_cores` argument to 1.

spec.get_MC_peakshape_errors(steps=1000, thin=20, N_samples=50, n_cores=1) # arguments adapted for demonstration
#spec.get_MC_peakshape_errors() # typical execution with default arguments and all available cores

### Evaluating posterior PDFs using MCMC sampling ###

Number of varied parameters:         ndim = 11
Number of MCMC steps:               steps = 1000
Number of initial steps to discard:  burn = 500
Length of thinning interval:         thin = 20
Number of CPU cores to use:       n_cores = 1

The chain is shorter than 50 times the integrated autocorrelation time for 11 parameter(s). Use this estimate with caution and run a longer chain!
N/50 = 20;
tau: [70.43004306 67.98874971 66.95520041 71.11190714 67.88493661 73.22160349
 70.62246236 74.59595035 72.63641072 71.24289814 68.95743422]
_images/emgfit_tutorial_23_3.png
_images/emgfit_tutorial_23_4.png
WARNING:root:The chain is shorter than 50 times the integrated autocorrelation time for 11 parameter(s). Use this estimate with caution and run a longer chain!
N/50 = 20;
tau: [70.43004306 67.98874971 66.95520041 71.11190714 67.88493661 73.22160349
 70.62246236 74.59595035 72.63641072 71.24289814 68.95743422]
/home/travis/virtualenv/python3.7.1/lib/python3.7/site-packages/emgfit/spectrum.py:1762: UserWarning: Thinning interval `thin` is less than the integrated autocorrelation time for at least one parameter. Consider increasing `thin` MCMC keyword argument to ensure independent parameter samples.
  UserWarning)
Autocorrelation time for the parameters:
----------------------------------------
     bkg_c: 70.43 steps
    p6_amp: 67.99 steps
     p6_mu: 66.96 steps
  p6_sigma: 71.11 steps
  p6_theta: 67.88 steps
 p6_eta_m1: 73.22 steps
 p6_tau_m1: 70.62 steps
 p6_tau_m2: 74.60 steps
 p6_eta_p1: 72.64 steps
 p6_tau_p1: 71.24 steps
 p6_tau_p2: 68.96 steps

Total number of MCMC parameter sets after discarding burn-in and thinning: 5500


Covariance map for peak 6 with 0.16, 0.50 & 0.84 quantiles (dashed lines) and best-fit values (blue lines):
_images/emgfit_tutorial_23_7.png

##### MC Peak-shape uncertainty evaluation for peaks 0,1,2,3,4,5,6,7 #####

Determining MC recalibration factors from shifted centroids of mass calibrant.

All mass uncertainties below take into account the corresponding mass shifts of the calibrant peak.

Fitting peaks with 50 different MCMC-shape-parameter sets to determine refined peak-shape errors.

### Results ###

         Relative peak-shape (mass) uncertainty     Peak-shape uncertainty of
         from +-1σ variation / from MC samples      peak areas from MC samples
Peak  0:           2.04e-08  /  9.34e-09                     0.3 counts
Peak  1:           2.42e-08  /  9.36e-09                     0.4 counts
Peak  2:           1.64e-08  /  3.76e-09                     2.0 counts
Peak  3:           8.34e-09  /  1.78e-09                     1.2 counts
Peak  4:           0.00e+00  /  0.00e+00                    10.6 counts
Peak  5:           1.14e-08  /  5.01e-09                     6.4 counts
Peak  6:           3.30e-09  /  8.65e-10                     8.7 counts
Peak  7:           1.59e-07  /  6.25e-08                     3.1 counts

Updated area error, peak-shape error and (total) mass error of peak(s) 0,1,2,3,4,5,6,7.


Peak properties table after MC peak-shape error evaluation:
x_pos species comment m_AME m_AME_error extrapolated fit_model cost_func red_chi area area_error m_ion rel_stat_error rel_recal_error rel_peakshape_error rel_mass_error A atomic_ME_keV mass_error_keV m_dev_keV
0 61.927800 Ni62:-1e - 61.927796 0.000000 False emg22 MLE 1.21 38.34 6.95 blinded 3.48e-07 1.16e-08 9.34e-09 3.48e-07 62 blinded 20.10 blinded
1 61.932021 Cu62:-1e? - nan nan False emg22 MLE 1.21 27.65 5.99 61.932051 2.84e-07 1.16e-08 9.36e-09 2.84e-07 nan nan 16.41 nan
2 61.934369 ? Non-isobaric nan nan False emg22 MLE 1.21 3870.51 64.26 61.934369 3.40e-08 1.16e-08 3.76e-09 3.62e-08 nan nan 2.09 nan
3 61.943618 Ga62:-1e - 61.943641 0.000001 False emg22 MLE 1.21 953.66 33.45 61.943636 6.62e-08 1.16e-08 1.78e-09 6.72e-08 62 -51992.04 3.88 -5.12
4 61.946994 Ti46:O16:-1e mass calibrant 61.946993 0.000000 False emg22 MLE 1.21 33993.44 143.21 blinded 1.12e-08 1.16e-08 nan nan 62 blinded nan blinded
5 61.949527 Sc46:O16:-1e - 61.949534 0.000001 False emg22 MLE 1.21 1572.09 39.25 61.949540 5.10e-08 1.16e-08 5.01e-09 5.25e-08 62 -46492.38 3.03 5.84
6 61.956611 Ca43:F19:-1e shape calibrant 61.956621 0.000000 False emg22 MLE 1.21 25957.02 127.10 61.956622 1.19e-08 1.16e-08 8.65e-10 1.66e-08 62 -39895.65 0.96 0.62
7 61.958997 ? - nan nan False emg22 MLE 1.21 27.79 7.73 61.959017 4.16e-07 1.16e-08 6.25e-08 4.21e-07 nan nan 24.29 nan
         stat. errors from resampling     Monte Carlo peakshape errors

Export fit results

Once all peaks have been fitted, the results can be exported to an XLSX Excel file and a separate file with the peak-shape calibration parameters by using the save_results method. The XLSX file contains three sheets: 1. General properties the spectrum object, e.g. input filename, used version of emgfit and all relevant dependencies, …
2. The peak properties table and linear and logarithmic plots of the full spectrum fit. 3. The peak centroid shifts relative to the mass calibrant obtained in the peak-shape uncertainty evaluation.
[12]:
spec.save_results('outputs/'+filename+' fitting MLE')
<string>:6: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray
Fit results saved to file: outputs/2019-09-13_004-_006 SUMMED High stats 62Ga fitting MLE.xlsx

Peak-shape calibration saved to file: outputs/2019-09-13_004-_006 SUMMED High stats 62Ga fitting MLE_peakshape_calib.txt

That’s it! In principle we’re be done with the fitting at this point. Next we would probably take a look at the output file and proceed with some post-processing in Excel (e.g. combining mass values from different spectra etc.).

However, since emgfit gives the user a large amount of freedom, there’s are a number of things that could have been done differently depending on your preferences. So here is some possible…

Alternative procedures:

The above steps represent a full spectrum analysis. However, emgfit gives the user the freedom to take many different routes in processing the spectrum. Some of the possible alternatives are presented in the following:

Alternative 1: Performing the mass recalibration separately before the ion-of-interest fits

All steps up to the final peak fit are identical. For breviety here we simply create an exact clone of the above spectrum object:

[13]:
import copy
spec2 = copy.deepcopy(spec) # create a clone of the spectrum object

First obtain the recalibration factor from a fit of the mass calibrant

[14]:
spec2.fit_calibrant(species_mass_calib='Ti46:O16:-1e')
##### Calibrant fit #####
_images/emgfit_tutorial_31_1.png
_images/emgfit_tutorial_31_2.png

Model

((Model(constant, prefix='bkg_') + Model(emg22, prefix='p4_')) + Model(emg22, prefix='p5_'))

Fit Statistics

fitting methodleast_squares
# function evals13
# data points169
# variables5
chi-square 286.249241
reduced chi-square 1.74542220
Akaike info crit. 99.0569479
Bayesian info crit. 114.706442

Variables

name value standard error relative error initial value min max vary expression
bkg_c 1.11205858 0.13479317 (12.12%) 0.1 0.00000000 4.00000000 True
p4_amp 1.24523372 0.00683209 (0.55%) 1.0294480000000001 1.0000e-20 inf True
p4_mu nan 7.0048e-07 (nan%) 61.946994300285866 61.9463748 61.9476138 True
p4_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p4_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p4_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p4_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p4_eta_m1
p4_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p4_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p4_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p4_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p4_eta_p1
p4_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p4_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p5_amp 0.05645627 0.00148067 (2.62%) 0.050095999999999995 1.0000e-20 inf True
p5_mu 61.9495576 3.2508e-06 (0.00%) 61.94952680789496 61.9489073 61.9501463 True
p5_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p5_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p5_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p5_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p5_eta_m1
p5_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p5_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p5_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p5_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p5_eta_p1
p5_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p5_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False

Correlations (unreported correlations are < 0.100)

p4_ampp4_mu-0.1230

##### Mass recalibration #####

Relative literature error of mass calibrant:     2.8e-09
Relative statistical error of mass calibrant:    1.2e-08

Recalibration factor:    0.999999711 = 1 -2.9e-07
Relative recalibration error:    1.2e-08

Fit all peaks and use the mass recalibration factor from above to calculate the final mass values

[15]:
spec2.fit_peaks()
_images/emgfit_tutorial_33_0.png
_images/emgfit_tutorial_33_1.png

##### Peak-shape uncertainty evaluation #####

Determining absolute centroid shifts of mass calibrant.

All mass shifts below are corrected for the corresponding shifts of the mass calibrant peak.

Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  0 by  -0.15  /   0.24 μu  & its area by   0.1 /  -0.1 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  1 by   0.44  /  -0.44 μu  & its area by   0.2 /  -0.1 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  2 by  -0.22  /   0.35 μu  & its area by   0.4 /  -0.1 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  3 by  -0.03  /   0.01 μu  & its area by   0.4 /  -0.2 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  5 by  -0.02  /  -0.00 μu  & its area by   0.6 /  -0.6 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  6 by   0.01  /  -0.02 μu  & its area by   0.4 /  -0.3 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  7 by  -0.20  /  -0.12 μu  & its area by   0.2 /  -0.2 counts.

Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  0 by  -0.53  /   0.44 μu  & its area by  -0.2 /   0.2 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  1 by  -1.08  /   0.99 μu  & its area by  -0.4 /   0.3 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  2 by  -0.40  /   0.31 μu  & its area by  -0.7 /   0.6 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  3 by  -0.24  /   0.08 μu  & its area by  -0.9 /   0.8 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  5 by  -0.27  /   0.21 μu  & its area by  -0.2 /   0.1 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  6 by  -0.13  /   0.03 μu  & its area by  -2.4 /   2.1 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  7 by  -1.89  /   1.77 μu  & its area by   0.2 /  -0.2 counts.

Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  0 by   0.69  /  -0.60 μu  & its area by  -0.4 /   0.3 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  1 by   0.31  /  -0.29 μu  & its area by  -0.4 /   0.3 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  2 by   0.40  /  -0.39 μu  & its area by  -1.9 /   1.3 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  3 by   0.30  /  -0.25 μu  & its area by  -1.0 /   0.7 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  5 by   0.25  /  -0.21 μu  & its area by  -3.9 /   3.0 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  6 by   0.02  /  -0.08 μu  & its area by  -4.4 /   2.8 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  7 by   0.49  /  -0.50 μu  & its area by  -0.4 /   0.4 counts.

Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  0 by  -0.75  /   0.80 μu  & its area by   0.2 /  -0.1 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  1 by   0.20  /  -0.31 μu  & its area by   0.2 /  -0.2 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  2 by  -0.33  /   0.49 μu  & its area by   0.5 /  -0.2 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  3 by  -0.11  /   0.09 μu  & its area by   0.4 /  -0.3 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  5 by  -0.16  /   0.11 μu  & its area by   1.0 /  -0.5 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  6 by  -0.01  /  -0.00 μu  & its area by   5.5 /  -0.5 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  7 by  -1.05  /   0.76 μu  & its area by   0.2 /  -0.2 counts.

Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  0 by  -0.20  /   0.38 μu  & its area by   0.3 /  -0.4 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  1 by  -0.18  /   0.02 μu  & its area by   0.3 /  -0.5 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  2 by  -0.15  /   0.30 μu  & its area by   1.0 /  -2.3 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  3 by  -0.13  /   0.21 μu  & its area by   0.6 /  -1.1 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  5 by  -0.06  /   0.08 μu  & its area by   3.0 /  -3.8 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  6 by   0.02  /   0.00 μu  & its area by   9.6 /  -7.7 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  7 by  -0.17  /  -0.22 μu  & its area by   0.3 /  -0.5 counts.

Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  0 by  -0.04  /   0.10 μu  & its area by  -0.3 /   0.3 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  1 by  -0.32  /   0.12 μu  & its area by  -0.5 /   0.5 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  2 by  -0.11  /   0.24 μu  & its area by  -1.7 /   1.6 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  3 by  -0.05  /   0.11 μu  & its area by  -2.1 /   1.7 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  5 by  -0.26  /   0.16 μu  & its area by   0.3 /  -0.7 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  6 by   0.04  /  -0.04 μu  & its area by  -6.5 /   5.1 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  7 by  -4.17  /   2.99 μu  & its area by   1.0 /  -1.0 counts.

Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  0 by   0.15  /  -0.15 μu  & its area by   0.2 /  -0.1 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  1 by   0.32  /  -0.57 μu  & its area by   0.3 /  -0.3 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  2 by   0.43  /  -0.46 μu  & its area by   0.6 /  -0.5 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  3 by   0.17  /  -0.21 μu  & its area by   0.6 /  -0.8 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  5 by   0.02  /  -0.06 μu  & its area by   1.1 /  -1.2 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  6 by   0.01  /  -0.06 μu  & its area by   7.1 /   0.1 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  7 by   0.29  /  -0.52 μu  & its area by   0.3 /  -0.4 counts.

Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  0 by  -0.04  /   0.02 μu  & its area by   0.4 /  -0.5 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  1 by   0.32  /  -0.37 μu  & its area by   0.5 /  -0.6 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  2 by   0.03  /  -0.06 μu  & its area by   2.8 /  -3.0 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  3 by   0.04  /  -0.06 μu  & its area by   2.4 /  -2.7 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  5 by   0.43  /  -0.48 μu  & its area by  -7.8 /   5.2 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  6 by  -0.03  /   0.05 μu  & its area by  11.6 / -12.6 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  7 by   4.44  /  -8.61 μu  & its area by  -4.4 /   3.5 counts.

Relative peak-shape error of peak  0:  2.1e-08
Relative peak-shape error of peak  1:  2.4e-08
Relative peak-shape error of peak  2:  1.7e-08
Relative peak-shape error of peak  3:  8.3e-09
Relative peak-shape error of peak  5:  1.1e-08
Relative peak-shape error of peak  6:  2.9e-09
Relative peak-shape error of peak  7:  1.6e-07
x_pos species comment m_AME m_AME_error extrapolated fit_model cost_func red_chi area area_error m_ion rel_stat_error rel_recal_error rel_peakshape_error rel_mass_error A atomic_ME_keV mass_error_keV m_dev_keV
0 61.927800 Ni62:-1e - 61.927796 0.000000 False emg22 MLE 1.21 38.34 6.81 blinded 3.46e-07 1.20e-08 2.07e-08 3.47e-07 62 blinded 20.01 blinded
1 61.932021 Cu62:-1e? - nan nan False emg22 MLE 1.21 27.65 6.07 61.932051 4.08e-07 1.20e-08 2.37e-08 4.08e-07 nan nan 23.56 nan
2 61.934369 ? Non-isobaric nan nan False emg22 MLE 1.21 3870.51 62.70 61.934369 3.44e-08 1.20e-08 1.65e-08 4.00e-08 nan nan 2.31 nan
3 61.943618 Ga62:-1e - 61.943641 0.000001 False emg22 MLE 1.21 953.66 31.43 61.943636 6.94e-08 1.20e-08 8.30e-09 7.09e-08 62 -51992.05 4.09 -5.14
4 61.946994 Ti46:O16:-1e mass calibrant 61.946993 0.000000 False emg22 MLE 1.75 33933.85 186.18 blinded 1.16e-08 1.20e-08 nan nan 62 blinded nan blinded
5 61.949527 Sc46:O16:-1e - 61.949534 0.000001 False emg22 MLE 1.21 1572.09 41.25 61.949540 5.40e-08 1.20e-08 1.11e-08 5.64e-08 62 -46492.40 3.26 5.83
6 61.956611 Ca43:F19:-1e shape calibrant 61.956621 0.000000 False emg22 MLE 1.21 25957.02 162.50 61.956622 1.33e-08 1.20e-08 2.89e-09 1.81e-08 62 -39895.67 1.05 0.60
7 61.958997 ? - nan nan False emg22 MLE 1.21 27.79 7.94 61.959017 4.06e-07 1.20e-08 1.59e-07 4.36e-07 nan nan 25.19 nan
The values for chi-squared as well as the parameter uncertainties and correlations reported by lmfit below should be taken with caution when your MLE fit includes bins with low statistics. For details see Notes section in the spectrum.peakfit() method documentation.

Model

((((((((Model(constant, prefix='bkg_') + Model(emg22, prefix='p0_')) + Model(emg22, prefix='p1_')) + Model(emg22, prefix='p2_')) + Model(emg22, prefix='p3_')) + Model(emg22, prefix='p4_')) + Model(emg22, prefix='p5_')) + Model(emg22, prefix='p6_')) + Model(emg22, prefix='p7_'))

Fit Statistics

fitting methodleast_squares
# function evals11
# data points1027
# variables17
chi-square 1222.57926
reduced chi-square 1.21047452
Akaike info crit. 213.027510
Bayesian info crit. 296.912263

Variables

name value standard error relative error initial value min max vary expression
bkg_c 0.27789812 0.02354870 (8.47%) 0.1 0.00000000 4.00000000 True
p0_amp 0.00140702 2.4803e-04 (17.63%) 0.001488 1.0000e-20 inf True
p0_mu nan 2.3155e-05 (nan%) 61.927800309876424 61.9271810 61.9284196 True
p0_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p0_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p0_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p0_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p0_eta_m1
p0_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p0_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p0_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p0_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p0_eta_p1
p0_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p0_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p1_amp 0.00101479 2.1873e-04 (21.55%) 0.000496 1.0000e-20 inf True
p1_mu 61.9320684 2.7578e-05 (0.00%) 61.93202053070152 61.9314012 61.9326399 True
p1_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p1_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p1_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p1_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p1_eta_m1
p1_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p1_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p1_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p1_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p1_eta_p1
p1_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p1_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p2_amp 0.14203203 0.00229478 (1.62%) 0.15648800000000002 1.0000e-20 inf True
p2_mu 61.9343873 2.0506e-06 (0.00%) 61.93436923761443 61.9337499 61.9349886 True
p2_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p2_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p2_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p2_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p2_eta_m1
p2_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p2_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p2_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p2_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p2_eta_p1
p2_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p2_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p3_amp 0.03499553 0.00114428 (3.27%) 0.031992 1.0000e-20 inf True
p3_mu 61.9436536 4.0801e-06 (0.00%) 61.943617703998214 61.9429983 61.9442371 True
p3_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p3_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p3_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p3_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p3_eta_m1
p3_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p3_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p3_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p3_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p3_eta_p1
p3_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p3_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p4_amp 1.24742061 0.00679048 (0.54%) 1.0294480000000001 1.0000e-20 inf True
p4_mu nan 7.0521e-07 (nan%) 61.946994300285866 61.9463748 61.9476138 True
p4_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p4_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p4_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p4_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p4_eta_m1
p4_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p4_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p4_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p4_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p4_eta_p1
p4_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p4_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p5_amp 0.05768914 0.00147153 (2.55%) 0.050095999999999995 1.0000e-20 inf True
p5_mu 61.9495577 3.1823e-06 (0.00%) 61.94952680789496 61.9489073 61.9501463 True
p5_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p5_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p5_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p5_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p5_eta_m1
p5_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p5_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p5_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p5_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p5_eta_p1
p5_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p5_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p6_amp 0.95251660 0.00591791 (0.62%) 0.8422080000000001 1.0000e-20 inf True
p6_mu 61.9566396 7.7843e-07 (0.00%) 61.95661076349748 61.9559912 61.9572303 True
p6_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p6_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p6_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p6_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p6_eta_m1
p6_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p6_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p6_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p6_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p6_eta_p1
p6_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p6_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p7_amp 0.00101970 2.3618e-04 (23.16%) 0.001488 1.0000e-20 inf True
p7_mu 61.9590345 3.1347e-05 (0.00%) 61.95899664282278 61.9583771 61.9596162 True
p7_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p7_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p7_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p7_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p7_eta_m1
p7_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p7_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p7_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p7_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p7_eta_p1
p7_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p7_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False

Alternative 2: Chi-square instead of MLE fitting

All steps up to the final peak fit are identical. For breviety here we simply create an exact clone of the above spectrum object and re-use the above peak-shape calibration (obtained with chi-square fitting):

[16]:
import copy
spec_chi_sq = copy.deepcopy(spec) # create a clone of the spectrum object

# Use Pearson's chi-squared statistic for A_stat_emg determination
spec_chi_sq.determine_A_stat_emg(species='Ca43:F19:-1e',x_range=0.004,cost_func='chi-square',plot_filename='outputs/'+filename+'_chi-square',N_spectra=10)
Creating synthetic spectra via bootstrap re-sampling and fitting them for A_stat determination.
Depending on the choice of `N_spectra` this can take a few minutes. Interrupt kernel if this takes too long.

Done!

[[Model]]
    Model(powerlaw)
[[Fit Statistics]]
    # fitting method   = leastsq
    # function evals   = 5
    # data points      = 8
    # variables        = 1
    chi-square         = 9.9670e-09
    reduced chi-square = 1.4239e-09
    Akaike info crit   = -162.027385
    Bayesian info crit = -161.947943
[[Variables]]
    amplitude:  1.4311e-04 +/- 1.3957e-05 (9.75%) (init = 1)
    exponent:  -0.5 (fixed)
_images/emgfit_tutorial_35_3.png
A_stat of a Gaussian model: 0.425
Default A_stat_emg for Hyper-EMG models: 0.52
A_stat_emg for this spectrum's emg22 fit model: 0.598 +- 0.059
[17]:
spec_chi_sq.fit_peaks(species_mass_calib='Ti46:O16:-1e',cost_func='chi-square') # use Pearson's chi-squared statistic
_images/emgfit_tutorial_36_0.png
_images/emgfit_tutorial_36_1.png

##### Mass recalibration #####

Relative literature error of mass calibrant:     2.8e-09
Relative statistical error of mass calibrant:    1.3e-08

Recalibration factor:    0.999999710 = 1 -2.9e-07
Relative recalibration error:    1.3e-08


##### Peak-shape uncertainty evaluation #####

Determining absolute centroid shifts of mass calibrant.

All mass shifts below are corrected for the corresponding shifts of the mass calibrant peak.

Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  0 by   0.52  /  -0.48 μu  & its area by   0.3 /  -0.3 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  1 by   0.68  /  -0.55 μu  & its area by   0.2 /  -0.2 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  2 by  -0.32  /   0.33 μu  & its area by  18.2 / -16.6 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  3 by  -0.11  /   0.10 μu  & its area by   1.8 /  -1.3 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  5 by  -0.04  /   0.05 μu  & its area by   2.1 /  -1.4 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  6 by   0.01  /  -0.01 μu  & its area by   7.3 /   6.7 counts.
Re-fitting with sigma  =  8.34e-05 +/- 2.96e-06 shifts peak  7 by  -1.88  /   1.73 μu  & its area by   0.3 /  -0.3 counts.

Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  0 by  -0.65  /   0.56 μu  & its area by  -0.4 /   0.4 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  1 by  -1.29  /   1.13 μu  & its area by  -0.5 /   0.4 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  2 by  -0.63  /   0.57 μu  & its area by -17.6 /  18.0 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  3 by  -0.26  /   0.23 μu  & its area by  -2.4 /   2.5 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  5 by  -0.16  /   0.16 μu  & its area by   0.1 /   0.5 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  6 by  -0.02  /   0.02 μu  & its area by   4.6 /   9.4 counts.
Re-fitting with theta  =  7.25e-01 +/- 2.35e-02 shifts peak  7 by  -2.33  /   2.13 μu  & its area by   0.2 /  -0.2 counts.

Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  0 by   0.48  /  -0.42 μu  & its area by  -0.6 /   0.4 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  1 by   0.07  /  -0.08 μu  & its area by  -0.6 /   0.4 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  2 by   0.50  /  -0.42 μu  & its area by  -8.5 /   9.4 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  3 by   0.47  /  -0.34 μu  & its area by  -2.6 /   2.4 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  5 by   0.24  /  -0.15 μu  & its area by  -4.1 /   3.3 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  6 by   0.03  /  -0.02 μu  & its area by   5.6 /  11.4 counts.
Re-fitting with eta_m1 =  9.20e-01 +/- 2.31e-02 shifts peak  7 by   0.86  /  -0.67 μu  & its area by  -0.7 /   0.5 counts.

Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  0 by  -0.62  /   0.62 μu  & its area by   0.4 /  -0.4 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  1 by   0.26  /  -0.20 μu  & its area by   0.3 /  -0.3 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  2 by  -0.61  /   0.60 μu  & its area by  18.6 / -16.6 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  3 by  -0.28  /   0.26 μu  & its area by   2.5 /  -1.9 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  5 by  -0.25  /   0.24 μu  & its area by   2.3 /  -1.3 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  6 by  -0.04  /   0.03 μu  & its area by   9.9 /   8.5 counts.
Re-fitting with tau_m1 =  4.49e-05 +/- 5.88e-06 shifts peak  7 by  -2.28  /   2.37 μu  & its area by   0.4 /  -0.4 counts.

Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  0 by   0.08  /  -0.08 μu  & its area by   0.5 /  -0.7 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  1 by   0.19  /  -0.39 μu  & its area by   0.5 /  -0.8 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  2 by  -0.11  /   0.21 μu  & its area by   4.9 /  -5.3 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  3 by  -0.17  /   0.27 μu  & its area by   1.8 /  -2.3 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  5 by  -0.01  /   0.08 μu  & its area by   3.4 /  -4.4 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  6 by   0.01  /  -0.01 μu  & its area by  11.8 /  -2.5 counts.
Re-fitting with tau_m2 =  1.77e-04 +/- 2.48e-05 shifts peak  7 by   0.05  /   0.10 μu  & its area by   0.5 /  -0.7 counts.

Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  0 by  -0.37  /   0.16 μu  & its area by  -0.6 /   0.4 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  1 by  -0.69  /   0.38 μu  & its area by  -0.7 /   0.6 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  2 by  -0.31  /   0.25 μu  & its area by  -9.7 /   9.6 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  3 by  -0.21  /   0.15 μu  & its area by  -3.1 /   2.8 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  5 by  -0.22  /   0.17 μu  & its area by   0.5 /  -0.7 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  6 by   0.02  /  -0.01 μu  & its area by   0.1 /  12.9 counts.
Re-fitting with eta_p1 =  7.90e-01 +/- 4.49e-02 shifts peak  7 by  -7.46  /   5.14 μu  & its area by   1.1 /  -1.1 counts.

Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  0 by  -0.29  /   0.26 μu  & its area by   0.2 /  -0.3 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  1 by   0.33  /  -0.64 μu  & its area by   0.4 /  -0.4 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  2 by   0.54  /  -0.68 μu  & its area by  13.7 / -14.2 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  3 by   0.23  /  -0.29 μu  & its area by   2.2 /  -2.0 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  5 by  -0.04  /   0.03 μu  & its area by   0.9 /   0.0 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  6 by  -0.00  /  -0.00 μu  & its area by   9.5 /   9.0 counts.
Re-fitting with tau_p1 =  1.24e-04 +/- 1.33e-05 shifts peak  7 by   0.30  /  -0.40 μu  & its area by   0.3 /  -0.4 counts.

Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  0 by   0.42  /  -0.61 μu  & its area by   0.5 /  -0.8 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  1 by   0.66  /  -0.93 μu  & its area by   0.7 /  -0.9 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  2 by   0.02  /  -0.08 μu  & its area by   5.3 /  -6.2 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  3 by   0.05  /  -0.11 μu  & its area by   2.6 /  -3.2 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  5 by   0.47  /  -0.57 μu  & its area by  -7.8 /   5.4 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  6 by  -0.02  /   0.02 μu  & its area by  17.4 /  -9.3 counts.
Re-fitting with tau_p2 =  4.08e-04 +/- 5.48e-05 shifts peak  7 by   8.43  / -22.03 μu  & its area by  -4.3 /   4.3 counts.

Relative peak-shape error of peak  0:  2.2e-08
Relative peak-shape error of peak  1:  3.3e-08
Relative peak-shape error of peak  2:  2.1e-08
Relative peak-shape error of peak  3:  1.2e-08
Relative peak-shape error of peak  5:  1.2e-08
Relative peak-shape error of peak  6:  9.9e-10
Relative peak-shape error of peak  7:  3.8e-07
x_pos species comment m_AME m_AME_error extrapolated fit_model cost_func red_chi area area_error m_ion rel_stat_error rel_recal_error rel_peakshape_error rel_mass_error A atomic_ME_keV mass_error_keV m_dev_keV
0 61.927800 Ni62:-1e - 61.927796 0.000000 False emg22 chi-square 0.99 40.92 7.64 blinded 3.61e-07 1.28e-08 2.23e-08 3.62e-07 62 blinded 20.89 blinded
1 61.932021 Cu62:-1e? - nan nan False emg22 chi-square 0.99 28.22 6.87 61.932067 4.35e-07 1.28e-08 3.27e-08 4.36e-07 nan nan 25.18 nan
2 61.934369 ? Non-isobaric nan nan False emg22 chi-square 0.99 3990.65 74.40 61.934370 3.66e-08 1.28e-08 2.13e-08 4.42e-08 nan nan 2.55 nan
3 61.943618 Ga62:-1e - 61.943641 0.000001 False emg22 chi-square 0.99 957.83 32.30 61.943635 7.46e-08 1.28e-08 1.24e-08 7.68e-08 62 -51992.21 4.43 -5.29
4 61.946994 Ti46:O16:-1e mass calibrant 61.946993 0.000000 False emg22 chi-square 0.99 34014.37 184.70 blinded 1.25e-08 1.28e-08 nan nan 62 blinded nan blinded
5 61.949527 Sc46:O16:-1e - 61.949534 0.000001 False emg22 chi-square 0.99 1573.74 41.74 61.949540 5.82e-08 1.28e-08 1.17e-08 6.08e-08 62 -46492.42 3.51 5.81
6 61.956611 Ca43:F19:-1e shape calibrant 61.956621 0.000000 False emg22 chi-square 0.99 25965.46 164.71 61.956622 1.43e-08 1.28e-08 9.89e-10 1.93e-08 62 -39895.70 1.11 0.57
7 61.958997 ? - nan nan False emg22 chi-square 0.99 27.46 8.37 61.958999 4.41e-07 1.28e-08 3.81e-07 5.83e-07 nan nan 33.62 nan

Model

((((((((Model(constant, prefix='bkg_') + Model(emg22, prefix='p0_')) + Model(emg22, prefix='p1_')) + Model(emg22, prefix='p2_')) + Model(emg22, prefix='p3_')) + Model(emg22, prefix='p4_')) + Model(emg22, prefix='p5_')) + Model(emg22, prefix='p6_')) + Model(emg22, prefix='p7_'))

Fit Statistics

fitting methodleast_squares
# function evals10
# data points1027
# variables17
chi-square 996.911904
reduced chi-square 0.98704149
Akaike info crit. 3.46235499
Bayesian info crit. 87.3471076

Variables

name value standard error relative error initial value min max vary expression
bkg_c 0.60918228 0.03486862 (5.72%) 0.1 0.00000000 4.00000000 True
p0_amp 0.00150146 2.7501e-04 (18.32%) 0.001488 1.0000e-20 inf True
p0_mu nan 2.6058e-05 (nan%) 61.927800309876424 61.9271810 61.9284196 True
p0_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p0_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p0_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p0_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p0_eta_m1
p0_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p0_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p0_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p0_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p0_eta_p1
p0_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p0_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p1_amp 0.00103564 2.4441e-04 (23.60%) 0.000496 1.0000e-20 inf True
p1_mu 61.9320845 3.0529e-05 (0.00%) 61.93202053070152 61.9314012 61.9326399 True
p1_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p1_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p1_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p1_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p1_eta_m1
p1_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p1_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p1_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p1_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p1_eta_p1
p1_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p1_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p2_amp 0.14644042 0.00234571 (1.60%) 0.15648800000000002 1.0000e-20 inf True
p2_mu 61.9343881 2.1401e-06 (0.00%) 61.93436923761443 61.9337499 61.9349886 True
p2_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p2_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p2_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p2_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p2_eta_m1
p2_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p2_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p2_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p2_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p2_eta_p1
p2_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p2_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p3_amp 0.03514850 0.00115474 (3.29%) 0.031992 1.0000e-20 inf True
p3_mu 61.9436535 4.1398e-06 (0.00%) 61.943617703998214 61.9429983 61.9442371 True
p3_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p3_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p3_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p3_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p3_eta_m1
p3_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p3_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p3_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p3_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p3_eta_p1
p3_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p3_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p4_amp 1.24818858 0.00677766 (0.54%) 1.0294480000000001 1.0000e-20 inf True
p4_mu nan 6.6772e-07 (nan%) 61.946994300285866 61.9463748 61.9476138 True
p4_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p4_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p4_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p4_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p4_eta_m1
p4_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p4_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p4_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p4_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p4_eta_p1
p4_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p4_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p5_amp 0.05774996 0.00148342 (2.57%) 0.050095999999999995 1.0000e-20 inf True
p5_mu 61.9495577 3.2400e-06 (0.00%) 61.94952680789496 61.9489073 61.9501463 True
p5_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p5_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p5_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p5_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p5_eta_m1
p5_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p5_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p5_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p5_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p5_eta_p1
p5_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p5_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p6_amp 0.95282659 0.00592393 (0.62%) 0.8422080000000001 1.0000e-20 inf True
p6_mu 61.9566396 7.6984e-07 (0.00%) 61.95661076349748 61.9559912 61.9572303 True
p6_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p6_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p6_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p6_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p6_eta_m1
p6_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p6_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p6_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p6_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p6_eta_p1
p6_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p6_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False
p7_amp 0.00100776 2.5608e-04 (25.41%) 0.001488 1.0000e-20 inf True
p7_mu 61.9590166 3.6227e-05 (0.00%) 61.95899664282278 61.9583771 61.9596162 True
p7_sigma 8.3414e-05 0.00000000 (0.00%) 8.341447302629027e-05 0.00000000 0.00508341 False
p7_theta 0.72471371 0.00000000 (0.00%) 0.7247137076255304 0.00000000 1.00000000 False
p7_eta_m1 0.92018998 0.00000000 (0.00%) 0.920189979387074 0.00000000 1.00000000 False
p7_eta_m2 0.07981002 0.00000000 (0.00%) 0.07981002061292597 0.00000000 1.00000000 False 1-p7_eta_m1
p7_tau_m1 4.4900e-05 0.00000000 (0.00%) 4.48999918068121e-05 1.0000e-12 0.05000000 False
p7_tau_m2 1.7683e-04 0.00000000 (0.00%) 0.00017682506547257428 1.0000e-12 0.05000000 False
p7_eta_p1 0.79009146 0.00000000 (0.00%) 0.7900914592527707 0.00000000 1.00000000 False
p7_eta_p2 0.20990854 0.00000000 (0.00%) 0.2099085407472293 0.00000000 1.00000000 False 1-p7_eta_p1
p7_tau_p1 1.2412e-04 0.00000000 (0.00%) 0.00012412446811073958 1.0000e-12 0.05000000 False
p7_tau_p2 4.0762e-04 0.00000000 (0.00%) 0.0004076177163038251 1.0000e-12 0.05000000 False