Mueller matrix

Exemplary fit of the complete Mueller matrix of 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': '2c6ee5d3-348c-43e7-b106-c4daf8b57b4c',
              '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': 'aa3b5a84-737c-4095-aa19-55d3b1209a97',
              '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': '31a8f6ec-d005-4b15-b2ef-ee3aea0fa73b',
              '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': 'b46732a6-d821-4261-8c60-751931c54d03',
              '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': 'a62d1495-1606-4b7f-852f-3c56e9657abc',
              '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': 'e06a92dd-6689-45e9-ae22-3f437aa9bccb',
              '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': '31b0b62d-2fea-4442-8406-38d428a22b98',
              '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': '6cbf39ec-5870-40e7-8c42-c3afb5d13e6e',
              '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': 'aa6eb66e-6cf4-4742-8343-5c6ea265bdf9',
              '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': '0c5bad68-310a-4901-933d-b2d912018cb2',
              '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': '1c6f2a71-d369-4a67-8517-46aa7dffdb0f',
              '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': 'fa027c51-9b2d-4456-87c5-737ba1fabdfb',
              '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': '6f339f9d-8318-455a-8d3c-75034fa15ca2',
              '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': '61af8197-5d42-46be-9875-b3d7e292adbc',
              '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': 'be0fde94-fb82-43f7-bc87-1b9ffb9c6cd0',
              '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': '224a0a25-a1a0-4123-b8ad-e35962e80626',
              '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': 'e0d27321-5770-48a1-8acc-d533c7df77df',
              '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': '8b140719-3fd8-43e1-84b5-cabeddbb8eca',
              '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': '2fc7b096-ad3b-48a8-ad89-036a768e2636',
              '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': '3aca1b3d-3fda-4501-91d3-0539615c9e35',
              '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': '748ed98c-583f-42a4-8b8f-f2a3859d74f5',
              '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': '06884e94-d8f6-44e8-a4ac-bf5f6c8de891',
              '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': 'ea1d9a08-dd9a-490f-a049-cff41ac06895',
              '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': 'c6b8a8b0-5454-44d0-ae4d-d11db662c18c',
              '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': 'f118dfed-5610-4082-81fe-77d3217089d7',
              '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': '5b2b0b2b-8a0d-48c7-b221-95a5b0321096',
              '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': 'b681b3e4-b552-4bde-a4a1-432da64741b4',
              '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': '564090e2-7a04-4bfb-8e29-59f77359ae19',
              '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': '0a4b2cf9-6ecc-40aa-8597-ba450c31e306',
              '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': '66241128-282d-426d-806f-fda72e5d6300',
              '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': 'c9d2d6f3-f05e-4f44-9e42-7598e626ffe4',
              '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': '64823252-f11f-4d52-9321-4e04d7b3ff72',
              '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': '7bf6e6b5-dc52-4e47-b916-5533c1454dc1',
              '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': '64eb6aa6-d69b-43f4-95b9-e6a573d1b038',
              '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': 'b40343f6-5b63-4c6b-a03b-949c3a1d1199',
              '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': '6d5f5284-d2a4-4fa6-8d05-262b62037a7f',
              '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': '7afaf8e4-4aa2-4f2f-ab97-8d61ca0a34fa',
              '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': '9e395cb9-b5de-4f1c-b8e7-45db078b9a5c',
              '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': '96c7ff43-3d37-4cec-8db4-140b619a2c8e',
              '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': 'df32a428-bd62-4b44-a222-d1f1bf6955f1',
              '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': '0402266f-827f-4ca7-9479-8f9f7d9bb2a7',
              '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': '7981684f-a8fb-42b1-bd52-493cb878d7b6',
              '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': '193cdeb6-44d8-4862-a8d8-7eea116593cd',
              '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': 'abff7cab-a2a9-4363-92b9-e6f8383853b6',
              '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': '525cbbfb-b6c8-4076-9aeb-81bf27b85870',
              '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': 'a6cbd64c-c5c3-4777-a725-b4cdf36228d5',
              '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': 'dbcb3400-2658-4b51-a1db-13d6252784e0',
              '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': '0f4fd48c-fa51-4e1c-bae6-9d4a6eadb5ba',
              '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': 'fb3d164b-f9bc-4b6f-985f-89cc2b47ba5c',
              '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': '46ab122a-a013-434c-b936-c1d18654f228',
              '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': '98a6e83c-f3c4-4b57-a410-1f84886495ee',
              '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': '507e7bf0-0abe-4015-8c11-3bafdd5de403',
              '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': 'af64087a-5d50-495c-9e96-23d71edc5c5a',
              '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': '51d49e30-6ee7-4016-9f9d-67c85029f12d',
              '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': 'ce27784e-4e84-4f10-ae04-ee6bafd0b942',
              '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': 'b1d32c9b-7ae3-4c79-a39e-a5005ed3f0e7',
              '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': 'ee5a0bd7-656e-4b1a-913a-b5b2cb33da59',
              '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': '76485b2d-5004-4c66-9aab-441a9915fd5e',
              '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': '2599b509-1359-4c60-b704-d433af787936',
              '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': '6ed77f0e-fc46-4a33-b171-1aa8aaba28da',
              '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': '36021663-7556-41a3-abc1-e604587c013e',
              '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': '76493e8c-967a-4a18-a36f-6aeb6da8ae69',
              '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': 'c9a43966-a381-4ddb-8d68-09775f212526',
              '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': '8ffa0fd0-14a1-456c-a377-bbb5b9a43339',
              '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': '7067740e-848e-4e86-bd18-452d4e97720a',
              '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': '76ec4408-7c5f-49a9-be3d-1eaeb148774a',
              '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': '4c1632b9-1367-46c3-85b2-acffd33de834',
              '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': '2e170a87-af0b-4e3f-9334-d0e91ca8fbe1',
              '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': '8e232ddb-bb35-4bf1-969e-ffdb668b874c',
              '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': '0e0cb24e-efc0-4e1d-afe1-818692e93717',
              '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': 'd93d6e20-b66f-41ad-bede-2c3b6cf52772',
              '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': '9b6b3378-6006-41fb-b49c-eec43219979b',
              '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': '91e677aa-7312-457b-aa4d-7ee910937edc',
              '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': '148b5b18-5db1-4bfb-9f56-77309d3e2537',
              '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': '688301dd-0009-48b4-964d-fe211f41cd96',
              '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': 'b0d05a08-bcd2-4d0a-aefe-75844bd2b082',
              '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': '5040a8f0-1356-45e9-985a-36b329e6157f',
              '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': 'ff4a524a-525c-4dbd-af77-8d3f837bc171',
              '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': '19623769-dd4a-4ca8-ab72-4f4a3cdfd0b0',
              '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': '9fa9a520-760d-4ea5-9e15-9313b23418d3',
              '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': '42b0e87a-8d1c-4d07-9731-6a01ff9bf900',
              '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': '6d047041-3a0e-4dde-9ba7-eadc5cef763a',
              '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': 'c6627e96-fe57-4444-a0a2-5a1dcad6be51',
              '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': '6d26de26-129e-48b5-9d33-b58f1be3d177',
              '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': 'e8a0eb9c-a7b8-4441-8c0d-4df76e9f816f',
              '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': '3ad3f77d-b9cc-4a2f-a78a-ab448cce7bb5',
              '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': '5dd21b69-b543-4fc1-b167-56562e027a54',
              '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': '55807e9e-46c6-41c6-bba6-ace73591167c',
              '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': '094f1266-bb55-4df7-a937-d4e6fc638635',
              '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': 'e8330002-6543-43c5-9eb4-2c6d1e1f81e0',
              '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': 'c6abc14c-5ea0-45e4-8be2-e217ac46d69d',
              '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': '824ee98f-c288-4c9c-8cc6-c0fb30f0a41c',
              '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': '3d074cf0-88ea-44f1-9623-fae8aef4efd9',
              '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': '5ce8841a-4838-45b6-be56-367b430df68f',
              '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': '61d36eb3-a5bf-4421-85ec-dc02256a9e12',
              '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': '16513f7b-d547-409e-8058-3d3bf53bb097',
              '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 3.402 seconds)