Mueller matrix

Mueller matrix fit to a SiO2 on Si measurement.

import elli
from elli.fitting import ParamsHist, fit_mueller_matrix

Read data

We load the data from an ascii file containing each of the mueller matrix elements. The wavelength range is cut to be in between 210 nm and 820 nm, to stay in the range of the provided literature values for Si. The data is expected to be in a pandas dataframe containing the columns Mxy, where x and y refer to the matrix element inside the mueller matrix. The data is scaled by the M11 element, such that \(M_{11} = 1\) for all wavelengths. To show the structure we print the MM dataframe. If you load your data from another source make sure it adheres to this form.

MM = elli.read_spectraray_mmatrix("Wafer_MM_70.txt").loc[210:820]
print(MM)
            M11      M12      M13      M14  ...      M41      M42      M43      M44
Wavelength                                  ...
210.30366   1.0 -0.09147 -0.01241 -0.00614  ...  0.00986  0.00048 -0.95574  0.25821
210.76102   1.0 -0.10879 -0.01151 -0.00901  ...  0.00917  0.01319 -0.96899  0.24432
211.21834   1.0 -0.10639 -0.00694 -0.00475  ...  0.00712  0.00891 -0.96191  0.24986
211.67561   1.0 -0.11544 -0.02094 -0.00348  ...  0.01877  0.01726 -0.95951  0.25408
212.13284   1.0 -0.12199  0.02182  0.00480  ... -0.01790 -0.01957 -0.95493  0.28308
...         ...      ...      ...      ...  ...      ...      ...      ...      ...
818.08934   1.0 -0.44285 -0.00048 -0.00288  ...  0.00292 -0.00276 -0.87949  0.15713
818.50589   1.0 -0.44301  0.00376  0.00118  ... -0.00159 -0.01090 -0.87876  0.16422
818.92240   1.0 -0.44245  0.00887  0.00626  ... -0.00585 -0.01388 -0.87960  0.16743
819.33886   1.0 -0.44406 -0.00646 -0.00610  ...  0.00882  0.00424 -0.87907  0.15105
819.75528   1.0 -0.44381  0.01170  0.00550  ... -0.00692 -0.01260 -0.87849  0.16637

[1396 rows x 16 columns]

Setting start parameters

Here we set the start parameters for the SiO2 cauchy dispersion and thickness of the layer.

params = ParamsHist()
params.add("SiO2_n0", value=1.452, min=-100, max=100, vary=True)
params.add("SiO2_n1", value=36.0, min=-40000, max=40000, vary=True)
params.add("SiO2_n2", value=0, min=-40000, max=40000, vary=True)
params.add("SiO2_k0", value=0, min=-100, max=100, vary=True)
params.add("SiO2_k1", value=0, min=-40000, max=40000, vary=True)
params.add("SiO2_k2", value=0, min=-40000, max=40000, vary=True)
params.add("SiO2_d", value=120, min=0, max=40000, vary=True)

Load silicon dispersion from the refractiveindexinfo database

You can load any material from the index refractiveindex.info, which is embedded into the software (so you may use it offline, too). Here, we are interested in the literature values for the silicon substrate. First we need to load the database with rii_db = elli.db.RII() and then we can query it with rii_db.get_mat("Si", "Aspnes") to load this entry.

rii_db = elli.db.RII()
Si = rii_db.get_mat("Si", "Aspnes")

Building the model

Here the model is build and the experimental structure is returned. For details on this process please refer to the Basic usage example. When executed in an jupyter notebook this displays an interactive graph with which you can select the start parameters before fitting the data.

@fit_mueller_matrix(MM, params, display_single=False, sharex=True, full_scale=False)
def model(lbda, params):
    SiO2 = elli.Cauchy(
        params["SiO2_n0"],
        params["SiO2_n1"],
        params["SiO2_n2"],
        params["SiO2_k0"],
        params["SiO2_k1"],
        params["SiO2_k2"],
    ).get_mat()

    Layer = [elli.Layer(SiO2, params["SiO2_d"])]

    return elli.Structure(elli.AIR, Layer, Si).evaluate(
        lbda, 70, solver=elli.Solver4x4, propagator=elli.PropagatorExpm()
    )

Plot & Fit the model

Here we plot the model at the initial parameter set vs. the experimental data.

model.plot()
FigureWidget({
    'data': [{'line': {'color': '#636EFA', 'dash': 'solid'},
              'name': 'M11 ',
              'type': 'scatter',
              'uid': 'e1e77460-813d-473d-9585-1355baed4087',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x',
              'y': array([1., 1., 1., ..., 1., 1., 1.], shape=(1396,)),
              'yaxis': 'y'},
             {'line': {'color': '#636EFA', 'dash': 'dash'},
              'name': 'M11 theory',
              'type': 'scatter',
              'uid': 'e6bfafbe-bc1e-4f64-b4d9-8d73dbc971ba',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x',
              'y': array([1., 1., 1., ..., 1., 1., 1.], shape=(1396,)),
              'yaxis': 'y'},
             {'line': {'color': '#EF553B', 'dash': 'solid'},
              'name': 'M12 ',
              'type': 'scatter',
              'uid': 'bb9b84ef-f0c1-465f-89cd-5304edf676f9',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x2',
              'y': array([-0.09147, -0.10879, -0.10639, ..., -0.44245, -0.44406, -0.44381],
                         shape=(1396,)),
              'yaxis': 'y2'},
             {'line': {'color': '#EF553B', 'dash': 'dash'},
              'name': 'M12 theory',
              'type': 'scatter',
              'uid': '2debead8-f0ef-4fbc-9f03-9bb46a1c33a1',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x2',
              'y': array([ 0.48855385,  0.48240998,  0.47406745, ..., -0.27742534, -0.27818747,
                          -0.27894785], shape=(1396,)),
              'yaxis': 'y2'},
             {'line': {'color': '#00CC96', 'dash': 'solid'},
              'name': 'M13 ',
              'type': 'scatter',
              'uid': 'ca886866-a8a2-443c-971b-aa7d87fbf84a',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x3',
              'y': array([-0.01241, -0.01151, -0.00694, ...,  0.00887, -0.00646,  0.0117 ],
                         shape=(1396,)),
              'yaxis': 'y3'},
             {'line': {'color': '#00CC96', 'dash': 'dash'},
              'name': 'M13 theory',
              'type': 'scatter',
              'uid': '2b28325a-d629-4712-a313-698c8942ecb6',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x3',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y3'},
             {'line': {'color': '#AB63FA', 'dash': 'solid'},
              'name': 'M14 ',
              'type': 'scatter',
              'uid': '7bc45ddf-aa24-45f1-9734-2874384fc061',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x4',
              'y': array([-0.00614, -0.00901, -0.00475, ...,  0.00626, -0.0061 ,  0.0055 ],
                         shape=(1396,)),
              'yaxis': 'y4'},
             {'line': {'color': '#AB63FA', 'dash': 'dash'},
              'name': 'M14 theory',
              'type': 'scatter',
              'uid': '62cb2b4e-7f8a-4a0f-8f86-fda110eb1bf6',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x4',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y4'},
             {'line': {'color': '#FFA15A', 'dash': 'solid'},
              'name': 'M21 ',
              'type': 'scatter',
              'uid': 'd0da39c8-3b47-442d-8518-0edd485eda7c',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x5',
              'y': array([-0.09605, -0.09754, -0.10761, ..., -0.44024, -0.44126, -0.44135],
                         shape=(1396,)),
              'yaxis': 'y5'},
             {'line': {'color': '#FFA15A', 'dash': 'dash'},
              'name': 'M21 theory',
              'type': 'scatter',
              'uid': 'e69b863e-cdf6-4f49-8a17-7ecda5b020d7',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x5',
              'y': array([ 0.48855385,  0.48240998,  0.47406745, ..., -0.27742534, -0.27818747,
                          -0.27894785], shape=(1396,)),
              'yaxis': 'y5'},
             {'line': {'color': '#19D3F3', 'dash': 'solid'},
              'name': 'M22 ',
              'type': 'scatter',
              'uid': 'cc6d6639-432a-4e46-84a4-588674654882',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x6',
              'y': array([0.99426, 0.99475, 0.99637, ..., 0.99723, 0.99661, 0.99606],
                         shape=(1396,)),
              'yaxis': 'y6'},
             {'line': {'color': '#19D3F3', 'dash': 'dash'},
              'name': 'M22 theory',
              'type': 'scatter',
              'uid': '45cd6c7f-c525-4ebd-bd17-08715cc4f27e',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x6',
              'y': array([1., 1., 1., ..., 1., 1., 1.], shape=(1396,)),
              'yaxis': 'y6'},
             {'line': {'color': '#FF6692', 'dash': 'solid'},
              'name': 'M23 ',
              'type': 'scatter',
              'uid': '1253bf76-7c91-4c40-9c72-c545bfef3414',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x7',
              'y': array([-0.00364, -0.00427, -0.00207, ..., -0.00457,  0.00234, -0.00653],
                         shape=(1396,)),
              'yaxis': 'y7'},
             {'line': {'color': '#FF6692', 'dash': 'dash'},
              'name': 'M23 theory',
              'type': 'scatter',
              'uid': '0689dfdb-d063-476e-bff9-c2f73a857b32',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x7',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y7'},
             {'line': {'color': '#B6E880', 'dash': 'solid'},
              'name': 'M24 ',
              'type': 'scatter',
              'uid': 'ec9a2f5f-bda0-409b-8971-55084b8d3c84',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x8',
              'y': array([ 0.01084, -0.00325,  0.01123, ..., -0.00263,  0.00227, -0.00311],
                         shape=(1396,)),
              'yaxis': 'y8'},
             {'line': {'color': '#B6E880', 'dash': 'dash'},
              'name': 'M24 theory',
              'type': 'scatter',
              'uid': '4f47a5a6-050e-41f1-a9a3-1a5aed73983c',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x8',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y8'},
             {'line': {'color': '#FF97FF', 'dash': 'solid'},
              'name': 'M31 ',
              'type': 'scatter',
              'uid': 'a65ce258-cecd-4bdf-9364-b92a1749bd0e',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x9',
              'y': array([-0.00278, -0.00634, -0.00219, ...,  0.00055, -0.00105,  0.00037],
                         shape=(1396,)),
              'yaxis': 'y9'},
             {'line': {'color': '#FF97FF', 'dash': 'dash'},
              'name': 'M31 theory',
              'type': 'scatter',
              'uid': '6fb07681-53b3-4249-a3ce-1db6fc1e01d9',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x9',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y9'},
             {'line': {'color': '#FECB52', 'dash': 'solid'},
              'name': 'M32 ',
              'type': 'scatter',
              'uid': '6726bf36-3721-488e-b30d-16ab0318e416',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x10',
              'y': array([-0.00212, -0.00045,  0.0003 , ..., -0.0018 , -0.00042,  0.00037],
                         shape=(1396,)),
              'yaxis': 'y10'},
             {'line': {'color': '#FECB52', 'dash': 'dash'},
              'name': 'M32 theory',
              'type': 'scatter',
              'uid': '1df60688-b4f6-4631-814b-46402e6ba068',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x10',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y10'},
             {'line': {'color': '#636EFA', 'dash': 'solid'},
              'name': 'M33 ',
              'type': 'scatter',
              'uid': '662fefd7-7a70-4389-be33-5bdf3defc107',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x11',
              'y': array([0.27283, 0.26726, 0.2728 , ..., 0.16236, 0.16271, 0.16255],
                         shape=(1396,)),
              'yaxis': 'y11'},
             {'line': {'color': '#636EFA', 'dash': 'dash'},
              'name': 'M33 theory',
              'type': 'scatter',
              'uid': 'f1969937-57bc-4399-aa85-aff479d66c5e',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x11',
              'y': array([-0.78177026, -0.75168899, -0.71871123, ...,  0.20163327,  0.20156999,
                           0.20150625], shape=(1396,)),
              'yaxis': 'y11'},
             {'line': {'color': '#EF553B', 'dash': 'solid'},
              'name': 'M34 ',
              'type': 'scatter',
              'uid': '743d81c0-d6c7-4314-8fdd-dbfe4822516a',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x12',
              'y': array([0.95555, 0.9645 , 0.95821, ..., 0.87712, 0.87629, 0.87661],
                         shape=(1396,)),
              'yaxis': 'y12'},
             {'line': {'color': '#EF553B', 'dash': 'dash'},
              'name': 'M34 theory',
              'type': 'scatter',
              'uid': 'a8f7706b-cd0f-423b-ba05-08c9291c2e7a',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x12',
              'y': array([0.38749245, 0.44971578, 0.50863958, ..., 0.93935042, 0.93913858,
                          0.93892669], shape=(1396,)),
              'yaxis': 'y12'},
             {'line': {'color': '#00CC96', 'dash': 'solid'},
              'name': 'M41 ',
              'type': 'scatter',
              'uid': 'dc1cf19e-a59e-4a69-9962-537da1c3e3fe',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x13',
              'y': array([ 0.00986,  0.00917,  0.00712, ..., -0.00585,  0.00882, -0.00692],
                         shape=(1396,)),
              'yaxis': 'y13'},
             {'line': {'color': '#00CC96', 'dash': 'dash'},
              'name': 'M41 theory',
              'type': 'scatter',
              'uid': 'f0bbba85-9c72-4dca-917c-96a34de19a66',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x13',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y13'},
             {'line': {'color': '#AB63FA', 'dash': 'solid'},
              'name': 'M42 ',
              'type': 'scatter',
              'uid': '30b7a135-cef2-49e4-aa9d-fad04a220b67',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x14',
              'y': array([ 0.00048,  0.01319,  0.00891, ..., -0.01388,  0.00424, -0.0126 ],
                         shape=(1396,)),
              'yaxis': 'y14'},
             {'line': {'color': '#AB63FA', 'dash': 'dash'},
              'name': 'M42 theory',
              'type': 'scatter',
              'uid': 'a9461ae4-7193-41ef-add7-f2b59f3ab24f',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x14',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y14'},
             {'line': {'color': '#FFA15A', 'dash': 'solid'},
              'name': 'M43 ',
              'type': 'scatter',
              'uid': 'c413a7f6-fedf-4c9d-b1fc-bbcbbf594427',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x15',
              'y': array([-0.95574, -0.96899, -0.96191, ..., -0.8796 , -0.87907, -0.87849],
                         shape=(1396,)),
              'yaxis': 'y15'},
             {'line': {'color': '#FFA15A', 'dash': 'dash'},
              'name': 'M43 theory',
              'type': 'scatter',
              'uid': '9241dbb9-d52e-4bd8-bb59-ba32f3ae35af',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x15',
              'y': array([-0.38749245, -0.44971578, -0.50863958, ..., -0.93935042, -0.93913858,
                          -0.93892669], shape=(1396,)),
              'yaxis': 'y15'},
             {'line': {'color': '#19D3F3', 'dash': 'solid'},
              'name': 'M44 ',
              'type': 'scatter',
              'uid': '788880c0-0027-4df0-a0c2-5034c7b8bb9e',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x16',
              'y': array([0.25821, 0.24432, 0.24986, ..., 0.16743, 0.15105, 0.16637],
                         shape=(1396,)),
              'yaxis': 'y16'},
             {'line': {'color': '#19D3F3', 'dash': 'dash'},
              'name': 'M44 theory',
              'type': 'scatter',
              'uid': 'a9e981bb-f3e5-42a7-b6d0-8861990efae2',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x16',
              'y': array([-0.78177026, -0.75168899, -0.71871123, ...,  0.20163327,  0.20156999,
                           0.20150625], shape=(1396,)),
              'yaxis': 'y16'}],
    'layout': {'template': '...',
               'xaxis': {'anchor': 'y', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'xaxis10': {'anchor': 'y10', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis11': {'anchor': 'y11', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis12': {'anchor': 'y12', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis13': {'anchor': 'y13', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'xaxis14': {'anchor': 'y14', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis15': {'anchor': 'y15', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis16': {'anchor': 'y16', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis2': {'anchor': 'y2', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis3': {'anchor': 'y3', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis4': {'anchor': 'y4', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis5': {'anchor': 'y5', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'xaxis6': {'anchor': 'y6', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis7': {'anchor': 'y7', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis8': {'anchor': 'y8', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis9': {'anchor': 'y9', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'yaxis': {'anchor': 'x', 'domain': [0.80625, 1.0]},
               'yaxis10': {'anchor': 'x10', 'domain': [0.26875, 0.4625]},
               'yaxis11': {'anchor': 'x11', 'domain': [0.26875, 0.4625]},
               'yaxis12': {'anchor': 'x12', 'domain': [0.26875, 0.4625]},
               'yaxis13': {'anchor': 'x13', 'domain': [0.0, 0.19375]},
               'yaxis14': {'anchor': 'x14', 'domain': [0.0, 0.19375]},
               'yaxis15': {'anchor': 'x15', 'domain': [0.0, 0.19375]},
               'yaxis16': {'anchor': 'x16', 'domain': [0.0, 0.19375]},
               'yaxis2': {'anchor': 'x2', 'domain': [0.80625, 1.0]},
               'yaxis3': {'anchor': 'x3', 'domain': [0.80625, 1.0]},
               'yaxis4': {'anchor': 'x4', 'domain': [0.80625, 1.0]},
               'yaxis5': {'anchor': 'x5', 'domain': [0.5375, 0.73125]},
               'yaxis6': {'anchor': 'x6', 'domain': [0.5375, 0.73125]},
               'yaxis7': {'anchor': 'x7', 'domain': [0.5375, 0.73125]},
               'yaxis8': {'anchor': 'x8', 'domain': [0.5375, 0.73125]},
               'yaxis9': {'anchor': 'x9', 'domain': [0.26875, 0.4625]}}
})

We can also plot the residual between measurement and model.

model.plot_residual()
FigureWidget({
    'data': [{'line': {'color': '#636EFA', 'dash': 'solid'},
              'name': 'M11 ',
              'type': 'scatter',
              'uid': '525daa2c-8ccd-4929-ab60-f99c3f5ec853',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y'},
             {'line': {'color': '#EF553B', 'dash': 'solid'},
              'name': 'M12 ',
              'type': 'scatter',
              'uid': '04dd6adb-3c0b-479a-8531-c1c6f3b22e6e',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x2',
              'y': array([0.58002385, 0.59119998, 0.58045745, ..., 0.16502466, 0.16587253,
                          0.16486215], shape=(1396,)),
              'yaxis': 'y2'},
             {'line': {'color': '#00CC96', 'dash': 'solid'},
              'name': 'M13 ',
              'type': 'scatter',
              'uid': 'cafd42f4-c995-4f06-8799-b92c45aa7211',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x3',
              'y': array([ 0.01241,  0.01151,  0.00694, ..., -0.00887,  0.00646, -0.0117 ],
                         shape=(1396,)),
              'yaxis': 'y3'},
             {'line': {'color': '#AB63FA', 'dash': 'solid'},
              'name': 'M14 ',
              'type': 'scatter',
              'uid': '7b111d17-574a-4bb0-a1c1-9975e9432005',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x4',
              'y': array([ 0.00614,  0.00901,  0.00475, ..., -0.00626,  0.0061 , -0.0055 ],
                         shape=(1396,)),
              'yaxis': 'y4'},
             {'line': {'color': '#FFA15A', 'dash': 'solid'},
              'name': 'M21 ',
              'type': 'scatter',
              'uid': 'c1796c60-8a42-4426-91dd-590c31c9713a',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x5',
              'y': array([0.58460385, 0.57994998, 0.58167745, ..., 0.16281466, 0.16307253,
                          0.16240215], shape=(1396,)),
              'yaxis': 'y5'},
             {'line': {'color': '#19D3F3', 'dash': 'solid'},
              'name': 'M22 ',
              'type': 'scatter',
              'uid': '7c80bbce-9b3d-46b1-a648-2e82cfa69e7f',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x6',
              'y': array([0.00574, 0.00525, 0.00363, ..., 0.00277, 0.00339, 0.00394],
                         shape=(1396,)),
              'yaxis': 'y6'},
             {'line': {'color': '#FF6692', 'dash': 'solid'},
              'name': 'M23 ',
              'type': 'scatter',
              'uid': '88062f51-0ce0-49b3-91b6-5fe5930aaae1',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x7',
              'y': array([ 0.00364,  0.00427,  0.00207, ...,  0.00457, -0.00234,  0.00653],
                         shape=(1396,)),
              'yaxis': 'y7'},
             {'line': {'color': '#B6E880', 'dash': 'solid'},
              'name': 'M24 ',
              'type': 'scatter',
              'uid': '656b282d-a882-4369-a9a9-75bf65adf029',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x8',
              'y': array([-0.01084,  0.00325, -0.01123, ...,  0.00263, -0.00227,  0.00311],
                         shape=(1396,)),
              'yaxis': 'y8'},
             {'line': {'color': '#FF97FF', 'dash': 'solid'},
              'name': 'M31 ',
              'type': 'scatter',
              'uid': 'd5f63b94-4031-4edf-baf5-1854cefc0f82',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x9',
              'y': array([ 0.00278,  0.00634,  0.00219, ..., -0.00055,  0.00105, -0.00037],
                         shape=(1396,)),
              'yaxis': 'y9'},
             {'line': {'color': '#FECB52', 'dash': 'solid'},
              'name': 'M32 ',
              'type': 'scatter',
              'uid': 'e229bb3b-6112-440d-b4be-9bc31a6173a7',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x10',
              'y': array([ 0.00212,  0.00045, -0.0003 , ...,  0.0018 ,  0.00042, -0.00037],
                         shape=(1396,)),
              'yaxis': 'y10'},
             {'line': {'color': '#636EFA', 'dash': 'solid'},
              'name': 'M33 ',
              'type': 'scatter',
              'uid': '8e33c996-40d9-42a6-93f9-b24a4a911a6d',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x11',
              'y': array([-1.05460026, -1.01894899, -0.99151123, ...,  0.03927327,  0.03885999,
                           0.03895625], shape=(1396,)),
              'yaxis': 'y11'},
             {'line': {'color': '#EF553B', 'dash': 'solid'},
              'name': 'M34 ',
              'type': 'scatter',
              'uid': '9119391d-0c00-4a8a-9de2-fbe5319cdd4f',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x12',
              'y': array([-0.56805755, -0.51478422, -0.44957042, ...,  0.06223042,  0.06284858,
                           0.06231669], shape=(1396,)),
              'yaxis': 'y12'},
             {'line': {'color': '#00CC96', 'dash': 'solid'},
              'name': 'M41 ',
              'type': 'scatter',
              'uid': '7947fff6-da17-4b25-b4ac-0ea7ed3518e2',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x13',
              'y': array([-0.00986, -0.00917, -0.00712, ...,  0.00585, -0.00882,  0.00692],
                         shape=(1396,)),
              'yaxis': 'y13'},
             {'line': {'color': '#AB63FA', 'dash': 'solid'},
              'name': 'M42 ',
              'type': 'scatter',
              'uid': 'f4d68b60-655f-48e5-896e-026aa8d828d9',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x14',
              'y': array([-0.00048, -0.01319, -0.00891, ...,  0.01388, -0.00424,  0.0126 ],
                         shape=(1396,)),
              'yaxis': 'y14'},
             {'line': {'color': '#FFA15A', 'dash': 'solid'},
              'name': 'M43 ',
              'type': 'scatter',
              'uid': '9d4987ba-6ee2-4114-9696-5681bcaa0e4b',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x15',
              'y': array([ 0.56824755,  0.51927422,  0.45327042, ..., -0.05975042, -0.06006858,
                          -0.06043669], shape=(1396,)),
              'yaxis': 'y15'},
             {'line': {'color': '#19D3F3', 'dash': 'solid'},
              'name': 'M44 ',
              'type': 'scatter',
              'uid': 'f77d43e9-79d3-4f29-ae38-48c5374ec462',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x16',
              'y': array([-1.03998026, -0.99600899, -0.96857123, ...,  0.03420327,  0.05051999,
                           0.03513625], shape=(1396,)),
              'yaxis': 'y16'}],
    'layout': {'template': '...',
               'xaxis': {'anchor': 'y', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'xaxis10': {'anchor': 'y10', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis11': {'anchor': 'y11', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis12': {'anchor': 'y12', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis13': {'anchor': 'y13', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'xaxis14': {'anchor': 'y14', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis15': {'anchor': 'y15', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis16': {'anchor': 'y16', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis2': {'anchor': 'y2', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis3': {'anchor': 'y3', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis4': {'anchor': 'y4', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis5': {'anchor': 'y5', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'xaxis6': {'anchor': 'y6', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis7': {'anchor': 'y7', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis8': {'anchor': 'y8', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis9': {'anchor': 'y9', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'yaxis': {'anchor': 'x', 'domain': [0.80625, 1.0]},
               'yaxis10': {'anchor': 'x10', 'domain': [0.26875, 0.4625]},
               'yaxis11': {'anchor': 'x11', 'domain': [0.26875, 0.4625]},
               'yaxis12': {'anchor': 'x12', 'domain': [0.26875, 0.4625]},
               'yaxis13': {'anchor': 'x13', 'domain': [0.0, 0.19375]},
               'yaxis14': {'anchor': 'x14', 'domain': [0.0, 0.19375]},
               'yaxis15': {'anchor': 'x15', 'domain': [0.0, 0.19375]},
               'yaxis16': {'anchor': 'x16', 'domain': [0.0, 0.19375]},
               'yaxis2': {'anchor': 'x2', 'domain': [0.80625, 1.0]},
               'yaxis3': {'anchor': 'x3', 'domain': [0.80625, 1.0]},
               'yaxis4': {'anchor': 'x4', 'domain': [0.80625, 1.0]},
               'yaxis5': {'anchor': 'x5', 'domain': [0.5375, 0.73125]},
               'yaxis6': {'anchor': 'x6', 'domain': [0.5375, 0.73125]},
               'yaxis7': {'anchor': 'x7', 'domain': [0.5375, 0.73125]},
               'yaxis8': {'anchor': 'x8', 'domain': [0.5375, 0.73125]},
               'yaxis9': {'anchor': 'x9', 'domain': [0.26875, 0.4625]}}
})

Now we execute a fit and plot the model afterwards.

fit_stats = model.fit()
model.plot(full_scale=False)
FigureWidget({
    'data': [{'line': {'color': '#636EFA', 'dash': 'solid'},
              'name': 'M11 ',
              'type': 'scatter',
              'uid': '2acd89a5-39e8-4c63-a48f-3b4e05ee9e2f',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x',
              'y': array([1., 1., 1., ..., 1., 1., 1.], shape=(1396,)),
              'yaxis': 'y'},
             {'line': {'color': '#636EFA', 'dash': 'dash'},
              'name': 'M11 theory',
              'type': 'scatter',
              'uid': '071c2fb0-2a7f-46da-a673-a206f7e0df1c',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x',
              'y': array([1., 1., 1., ..., 1., 1., 1.], shape=(1396,)),
              'yaxis': 'y'},
             {'line': {'color': '#EF553B', 'dash': 'solid'},
              'name': 'M12 ',
              'type': 'scatter',
              'uid': '77f7b1f6-f9db-4a6c-a1a7-b6e786d223ff',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x2',
              'y': array([-0.09147, -0.10879, -0.10639, ..., -0.44245, -0.44406, -0.44381],
                         shape=(1396,)),
              'yaxis': 'y2'},
             {'line': {'color': '#EF553B', 'dash': 'dash'},
              'name': 'M12 theory',
              'type': 'scatter',
              'uid': '6ca44f69-e89b-41e6-a733-e99bf19f297b',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x2',
              'y': array([-0.09081776, -0.09659845, -0.10218436, ..., -0.44726608, -0.44776779,
                          -0.44826863], shape=(1396,)),
              'yaxis': 'y2'},
             {'line': {'color': '#00CC96', 'dash': 'solid'},
              'name': 'M13 ',
              'type': 'scatter',
              'uid': '4371287e-f1cc-4616-b74b-aae708ca7f47',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x3',
              'y': array([-0.01241, -0.01151, -0.00694, ...,  0.00887, -0.00646,  0.0117 ],
                         shape=(1396,)),
              'yaxis': 'y3'},
             {'line': {'color': '#00CC96', 'dash': 'dash'},
              'name': 'M13 theory',
              'type': 'scatter',
              'uid': '15dcfa74-b031-4c4f-bfe4-d6b8b62f9d10',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x3',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y3'},
             {'line': {'color': '#AB63FA', 'dash': 'solid'},
              'name': 'M14 ',
              'type': 'scatter',
              'uid': '31f7f3d9-6026-4928-b7a4-feee2a57c79f',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x4',
              'y': array([-0.00614, -0.00901, -0.00475, ...,  0.00626, -0.0061 ,  0.0055 ],
                         shape=(1396,)),
              'yaxis': 'y4'},
             {'line': {'color': '#AB63FA', 'dash': 'dash'},
              'name': 'M14 theory',
              'type': 'scatter',
              'uid': 'fde26583-b7a0-4722-9426-1ba7832a7b4e',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x4',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y4'},
             {'line': {'color': '#FFA15A', 'dash': 'solid'},
              'name': 'M21 ',
              'type': 'scatter',
              'uid': '3e96db51-b1cd-4894-8ca8-417bcc84f72e',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x5',
              'y': array([-0.09605, -0.09754, -0.10761, ..., -0.44024, -0.44126, -0.44135],
                         shape=(1396,)),
              'yaxis': 'y5'},
             {'line': {'color': '#FFA15A', 'dash': 'dash'},
              'name': 'M21 theory',
              'type': 'scatter',
              'uid': '2812af61-b26c-408e-bd56-39a9f3d28653',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x5',
              'y': array([-0.09081776, -0.09659845, -0.10218436, ..., -0.44726608, -0.44776779,
                          -0.44826863], shape=(1396,)),
              'yaxis': 'y5'},
             {'line': {'color': '#19D3F3', 'dash': 'solid'},
              'name': 'M22 ',
              'type': 'scatter',
              'uid': '9bfc5b03-4f8c-4bb8-a48f-39e0953f940a',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x6',
              'y': array([0.99426, 0.99475, 0.99637, ..., 0.99723, 0.99661, 0.99606],
                         shape=(1396,)),
              'yaxis': 'y6'},
             {'line': {'color': '#19D3F3', 'dash': 'dash'},
              'name': 'M22 theory',
              'type': 'scatter',
              'uid': 'f745ea50-9576-4d9b-b6e2-06b4fbb08fb0',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x6',
              'y': array([1., 1., 1., ..., 1., 1., 1.], shape=(1396,)),
              'yaxis': 'y6'},
             {'line': {'color': '#FF6692', 'dash': 'solid'},
              'name': 'M23 ',
              'type': 'scatter',
              'uid': '79d2c71c-e941-4528-9e96-0fc849468447',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x7',
              'y': array([-0.00364, -0.00427, -0.00207, ..., -0.00457,  0.00234, -0.00653],
                         shape=(1396,)),
              'yaxis': 'y7'},
             {'line': {'color': '#FF6692', 'dash': 'dash'},
              'name': 'M23 theory',
              'type': 'scatter',
              'uid': 'f831cb38-d3fb-471c-be07-cbafe0488fdb',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x7',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y7'},
             {'line': {'color': '#B6E880', 'dash': 'solid'},
              'name': 'M24 ',
              'type': 'scatter',
              'uid': 'f9424486-1b66-4388-b085-c34b81e293e5',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x8',
              'y': array([ 0.01084, -0.00325,  0.01123, ..., -0.00263,  0.00227, -0.00311],
                         shape=(1396,)),
              'yaxis': 'y8'},
             {'line': {'color': '#B6E880', 'dash': 'dash'},
              'name': 'M24 theory',
              'type': 'scatter',
              'uid': '0e92e5b5-274f-4b1c-a019-531e5bd886f5',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x8',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y8'},
             {'line': {'color': '#FF97FF', 'dash': 'solid'},
              'name': 'M31 ',
              'type': 'scatter',
              'uid': '527c59c5-35ca-4d4a-8c30-8bf1a23a8fc0',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x9',
              'y': array([-0.00278, -0.00634, -0.00219, ...,  0.00055, -0.00105,  0.00037],
                         shape=(1396,)),
              'yaxis': 'y9'},
             {'line': {'color': '#FF97FF', 'dash': 'dash'},
              'name': 'M31 theory',
              'type': 'scatter',
              'uid': '40b15c99-824e-43fd-a9f4-87a7017bc578',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x9',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y9'},
             {'line': {'color': '#FECB52', 'dash': 'solid'},
              'name': 'M32 ',
              'type': 'scatter',
              'uid': '2d28002d-c5df-4e65-93d5-c20de43d53ed',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x10',
              'y': array([-0.00212, -0.00045,  0.0003 , ..., -0.0018 , -0.00042,  0.00037],
                         shape=(1396,)),
              'yaxis': 'y10'},
             {'line': {'color': '#FECB52', 'dash': 'dash'},
              'name': 'M32 theory',
              'type': 'scatter',
              'uid': '6e634f1d-164d-48d0-b317-7fa9de1947e1',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x10',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y10'},
             {'line': {'color': '#636EFA', 'dash': 'solid'},
              'name': 'M33 ',
              'type': 'scatter',
              'uid': '91ed8a56-9c92-48a9-aff4-e66a812ae387',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x11',
              'y': array([0.27283, 0.26726, 0.2728 , ..., 0.16236, 0.16271, 0.16255],
                         shape=(1396,)),
              'yaxis': 'y11'},
             {'line': {'color': '#636EFA', 'dash': 'dash'},
              'name': 'M33 theory',
              'type': 'scatter',
              'uid': 'efb50289-4470-44e7-9946-1a95ecfd69d0',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x11',
              'y': array([0.28633493, 0.28495866, 0.28318747, ..., 0.15873433, 0.1585769 ,
                          0.15841941], shape=(1396,)),
              'yaxis': 'y11'},
             {'line': {'color': '#EF553B', 'dash': 'solid'},
              'name': 'M34 ',
              'type': 'scatter',
              'uid': '18fe98e5-4fcd-425b-8cfd-559dfc0cf2e1',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x12',
              'y': array([0.95555, 0.9645 , 0.95821, ..., 0.87712, 0.87629, 0.87661],
                         shape=(1396,)),
              'yaxis': 'y12'},
             {'line': {'color': '#EF553B', 'dash': 'dash'},
              'name': 'M34 theory',
              'type': 'scatter',
              'uid': 'b6ec8e01-e3d0-425f-b746-b808fcdf448f',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x12',
              'y': array([0.95381573, 0.95365995, 0.95360538, ..., 0.88020251, 0.87997578,
                          0.87974912], shape=(1396,)),
              'yaxis': 'y12'},
             {'line': {'color': '#00CC96', 'dash': 'solid'},
              'name': 'M41 ',
              'type': 'scatter',
              'uid': 'c25b754e-1cfd-4607-b513-a87b1d2faa9f',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x13',
              'y': array([ 0.00986,  0.00917,  0.00712, ..., -0.00585,  0.00882, -0.00692],
                         shape=(1396,)),
              'yaxis': 'y13'},
             {'line': {'color': '#00CC96', 'dash': 'dash'},
              'name': 'M41 theory',
              'type': 'scatter',
              'uid': 'bd5fc0da-67f6-4d0c-9c6f-29625bc4d9b0',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x13',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y13'},
             {'line': {'color': '#AB63FA', 'dash': 'solid'},
              'name': 'M42 ',
              'type': 'scatter',
              'uid': '5b1a746d-3369-4635-939f-99780a3df971',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x14',
              'y': array([ 0.00048,  0.01319,  0.00891, ..., -0.01388,  0.00424, -0.0126 ],
                         shape=(1396,)),
              'yaxis': 'y14'},
             {'line': {'color': '#AB63FA', 'dash': 'dash'},
              'name': 'M42 theory',
              'type': 'scatter',
              'uid': '27c25a21-8c41-4ec4-ab9d-a71eb366fea8',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x14',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y14'},
             {'line': {'color': '#FFA15A', 'dash': 'solid'},
              'name': 'M43 ',
              'type': 'scatter',
              'uid': 'dba052ec-c9f1-4c92-92b1-9060226663fe',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x15',
              'y': array([-0.95574, -0.96899, -0.96191, ..., -0.8796 , -0.87907, -0.87849],
                         shape=(1396,)),
              'yaxis': 'y15'},
             {'line': {'color': '#FFA15A', 'dash': 'dash'},
              'name': 'M43 theory',
              'type': 'scatter',
              'uid': 'f26b7f97-f3bc-4e9b-bde8-fa10f0dedab2',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x15',
              'y': array([-0.95381573, -0.95365995, -0.95360538, ..., -0.88020251, -0.87997578,
                          -0.87974912], shape=(1396,)),
              'yaxis': 'y15'},
             {'line': {'color': '#19D3F3', 'dash': 'solid'},
              'name': 'M44 ',
              'type': 'scatter',
              'uid': 'a4da8f89-277c-4f42-93ff-0133524496d2',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x16',
              'y': array([0.25821, 0.24432, 0.24986, ..., 0.16743, 0.15105, 0.16637],
                         shape=(1396,)),
              'yaxis': 'y16'},
             {'line': {'color': '#19D3F3', 'dash': 'dash'},
              'name': 'M44 theory',
              'type': 'scatter',
              'uid': '804f8d47-923b-4289-846a-6bdf0242618d',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x16',
              'y': array([0.28633493, 0.28495866, 0.28318747, ..., 0.15873433, 0.1585769 ,
                          0.15841941], shape=(1396,)),
              'yaxis': 'y16'}],
    'layout': {'template': '...',
               'xaxis': {'anchor': 'y', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'xaxis10': {'anchor': 'y10', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis11': {'anchor': 'y11', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis12': {'anchor': 'y12', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis13': {'anchor': 'y13', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'xaxis14': {'anchor': 'y14', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis15': {'anchor': 'y15', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis16': {'anchor': 'y16', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis2': {'anchor': 'y2', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis3': {'anchor': 'y3', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis4': {'anchor': 'y4', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis5': {'anchor': 'y5', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'xaxis6': {'anchor': 'y6', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis7': {'anchor': 'y7', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis8': {'anchor': 'y8', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis9': {'anchor': 'y9', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'yaxis': {'anchor': 'x', 'domain': [0.80625, 1.0]},
               'yaxis10': {'anchor': 'x10', 'domain': [0.26875, 0.4625]},
               'yaxis11': {'anchor': 'x11', 'domain': [0.26875, 0.4625]},
               'yaxis12': {'anchor': 'x12', 'domain': [0.26875, 0.4625]},
               'yaxis13': {'anchor': 'x13', 'domain': [0.0, 0.19375]},
               'yaxis14': {'anchor': 'x14', 'domain': [0.0, 0.19375]},
               'yaxis15': {'anchor': 'x15', 'domain': [0.0, 0.19375]},
               'yaxis16': {'anchor': 'x16', 'domain': [0.0, 0.19375]},
               'yaxis2': {'anchor': 'x2', 'domain': [0.80625, 1.0]},
               'yaxis3': {'anchor': 'x3', 'domain': [0.80625, 1.0]},
               'yaxis4': {'anchor': 'x4', 'domain': [0.80625, 1.0]},
               'yaxis5': {'anchor': 'x5', 'domain': [0.5375, 0.73125]},
               'yaxis6': {'anchor': 'x6', 'domain': [0.5375, 0.73125]},
               'yaxis7': {'anchor': 'x7', 'domain': [0.5375, 0.73125]},
               'yaxis8': {'anchor': 'x8', 'domain': [0.5375, 0.73125]},
               'yaxis9': {'anchor': 'x9', 'domain': [0.26875, 0.4625]}}
})

For comparison we plot the residual again to have a figure of merit for the fit quality

model.plot_residual()
FigureWidget({
    'data': [{'line': {'color': '#636EFA', 'dash': 'solid'},
              'name': 'M11 ',
              'type': 'scatter',
              'uid': '42ae30bc-29db-4f9f-ac6a-dcb17d052390',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x',
              'y': array([0., 0., 0., ..., 0., 0., 0.], shape=(1396,)),
              'yaxis': 'y'},
             {'line': {'color': '#EF553B', 'dash': 'solid'},
              'name': 'M12 ',
              'type': 'scatter',
              'uid': 'cd44aa6a-85c5-4ae3-a213-8dbb6ec911e0',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x2',
              'y': array([ 0.00065224,  0.01219155,  0.00420564, ..., -0.00481608, -0.00370779,
                          -0.00445863], shape=(1396,)),
              'yaxis': 'y2'},
             {'line': {'color': '#00CC96', 'dash': 'solid'},
              'name': 'M13 ',
              'type': 'scatter',
              'uid': 'bed2a6ee-2e3f-40c0-b5a6-a795d7a11cdc',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x3',
              'y': array([ 0.01241,  0.01151,  0.00694, ..., -0.00887,  0.00646, -0.0117 ],
                         shape=(1396,)),
              'yaxis': 'y3'},
             {'line': {'color': '#AB63FA', 'dash': 'solid'},
              'name': 'M14 ',
              'type': 'scatter',
              'uid': '30ea9110-60de-4f70-90f0-58758e8e97de',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x4',
              'y': array([ 0.00614,  0.00901,  0.00475, ..., -0.00626,  0.0061 , -0.0055 ],
                         shape=(1396,)),
              'yaxis': 'y4'},
             {'line': {'color': '#FFA15A', 'dash': 'solid'},
              'name': 'M21 ',
              'type': 'scatter',
              'uid': 'e315c14d-adad-4e87-92ff-0e4bb713ae43',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x5',
              'y': array([ 0.00523224,  0.00094155,  0.00542564, ..., -0.00702608, -0.00650779,
                          -0.00691863], shape=(1396,)),
              'yaxis': 'y5'},
             {'line': {'color': '#19D3F3', 'dash': 'solid'},
              'name': 'M22 ',
              'type': 'scatter',
              'uid': 'cdb2bb14-da2e-42a8-a193-4e2c42708855',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x6',
              'y': array([0.00574, 0.00525, 0.00363, ..., 0.00277, 0.00339, 0.00394],
                         shape=(1396,)),
              'yaxis': 'y6'},
             {'line': {'color': '#FF6692', 'dash': 'solid'},
              'name': 'M23 ',
              'type': 'scatter',
              'uid': 'c2378e58-e9ca-452e-a68e-40258b069b07',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x7',
              'y': array([ 0.00364,  0.00427,  0.00207, ...,  0.00457, -0.00234,  0.00653],
                         shape=(1396,)),
              'yaxis': 'y7'},
             {'line': {'color': '#B6E880', 'dash': 'solid'},
              'name': 'M24 ',
              'type': 'scatter',
              'uid': 'c3f68b01-5b31-48cb-8d6b-59abae13e5a9',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x8',
              'y': array([-0.01084,  0.00325, -0.01123, ...,  0.00263, -0.00227,  0.00311],
                         shape=(1396,)),
              'yaxis': 'y8'},
             {'line': {'color': '#FF97FF', 'dash': 'solid'},
              'name': 'M31 ',
              'type': 'scatter',
              'uid': '5239b356-31f9-4ce4-b49b-566903aad531',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x9',
              'y': array([ 0.00278,  0.00634,  0.00219, ..., -0.00055,  0.00105, -0.00037],
                         shape=(1396,)),
              'yaxis': 'y9'},
             {'line': {'color': '#FECB52', 'dash': 'solid'},
              'name': 'M32 ',
              'type': 'scatter',
              'uid': '3f6a18be-c221-47f2-b9aa-dc122a882517',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x10',
              'y': array([ 0.00212,  0.00045, -0.0003 , ...,  0.0018 ,  0.00042, -0.00037],
                         shape=(1396,)),
              'yaxis': 'y10'},
             {'line': {'color': '#636EFA', 'dash': 'solid'},
              'name': 'M33 ',
              'type': 'scatter',
              'uid': 'ca2cd4a0-8dc8-45b4-be29-4ce43dfa7e16',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x11',
              'y': array([ 0.01350493,  0.01769866,  0.01038747, ..., -0.00362567, -0.0041331 ,
                          -0.00413059], shape=(1396,)),
              'yaxis': 'y11'},
             {'line': {'color': '#EF553B', 'dash': 'solid'},
              'name': 'M34 ',
              'type': 'scatter',
              'uid': '154db3ca-cccc-44a5-8262-63a32118979c',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x12',
              'y': array([-0.00173427, -0.01084005, -0.00460462, ...,  0.00308251,  0.00368578,
                           0.00313912], shape=(1396,)),
              'yaxis': 'y12'},
             {'line': {'color': '#00CC96', 'dash': 'solid'},
              'name': 'M41 ',
              'type': 'scatter',
              'uid': 'a855ada7-c6fc-4928-a682-1ebcc7a1ad58',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x13',
              'y': array([-0.00986, -0.00917, -0.00712, ...,  0.00585, -0.00882,  0.00692],
                         shape=(1396,)),
              'yaxis': 'y13'},
             {'line': {'color': '#AB63FA', 'dash': 'solid'},
              'name': 'M42 ',
              'type': 'scatter',
              'uid': '79f55c58-ae20-4856-92d3-9e27d0faa64e',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x14',
              'y': array([-0.00048, -0.01319, -0.00891, ...,  0.01388, -0.00424,  0.0126 ],
                         shape=(1396,)),
              'yaxis': 'y14'},
             {'line': {'color': '#FFA15A', 'dash': 'solid'},
              'name': 'M43 ',
              'type': 'scatter',
              'uid': '63630737-5b78-4a37-93a6-530022c1006b',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x15',
              'y': array([ 0.00192427,  0.01533005,  0.00830462, ..., -0.00060251, -0.00090578,
                          -0.00125912], shape=(1396,)),
              'yaxis': 'y15'},
             {'line': {'color': '#19D3F3', 'dash': 'solid'},
              'name': 'M44 ',
              'type': 'scatter',
              'uid': 'a92e9ff0-0a1b-49e9-b442-8fddd28bbbff',
              'x': array([210.30366, 210.76102, 211.21834, ..., 818.9224 , 819.33886, 819.75528],
                         shape=(1396,)),
              'xaxis': 'x16',
              'y': array([ 0.02812493,  0.04063866,  0.03332747, ..., -0.00869567,  0.0075269 ,
                          -0.00795059], shape=(1396,)),
              'yaxis': 'y16'}],
    'layout': {'template': '...',
               'xaxis': {'anchor': 'y', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'xaxis10': {'anchor': 'y10', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis11': {'anchor': 'y11', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis12': {'anchor': 'y12', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis13': {'anchor': 'y13', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'xaxis14': {'anchor': 'y14', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis15': {'anchor': 'y15', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis16': {'anchor': 'y16', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis2': {'anchor': 'y2', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis3': {'anchor': 'y3', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis4': {'anchor': 'y4', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis5': {'anchor': 'y5', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'xaxis6': {'anchor': 'y6', 'domain': [0.2625, 0.475], 'matches': 'x'},
               'xaxis7': {'anchor': 'y7', 'domain': [0.525, 0.7375], 'matches': 'x'},
               'xaxis8': {'anchor': 'y8', 'domain': [0.7875, 1.0], 'matches': 'x'},
               'xaxis9': {'anchor': 'y9', 'domain': [0.0, 0.2125], 'matches': 'x'},
               'yaxis': {'anchor': 'x', 'domain': [0.80625, 1.0]},
               'yaxis10': {'anchor': 'x10', 'domain': [0.26875, 0.4625]},
               'yaxis11': {'anchor': 'x11', 'domain': [0.26875, 0.4625]},
               'yaxis12': {'anchor': 'x12', 'domain': [0.26875, 0.4625]},
               'yaxis13': {'anchor': 'x13', 'domain': [0.0, 0.19375]},
               'yaxis14': {'anchor': 'x14', 'domain': [0.0, 0.19375]},
               'yaxis15': {'anchor': 'x15', 'domain': [0.0, 0.19375]},
               'yaxis16': {'anchor': 'x16', 'domain': [0.0, 0.19375]},
               'yaxis2': {'anchor': 'x2', 'domain': [0.80625, 1.0]},
               'yaxis3': {'anchor': 'x3', 'domain': [0.80625, 1.0]},
               'yaxis4': {'anchor': 'x4', 'domain': [0.80625, 1.0]},
               'yaxis5': {'anchor': 'x5', 'domain': [0.5375, 0.73125]},
               'yaxis6': {'anchor': 'x6', 'domain': [0.5375, 0.73125]},
               'yaxis7': {'anchor': 'x7', 'domain': [0.5375, 0.73125]},
               'yaxis8': {'anchor': 'x8', 'domain': [0.5375, 0.73125]},
               'yaxis9': {'anchor': 'x9', 'domain': [0.26875, 0.4625]}}
})

We may also print the fit statistics.

fit_stats

Fit Result



References

Here you can find the latest jupyter notebook and data files of this example.

Total running time of the script: (0 minutes 2.130 seconds)