Note
Click here to download the full example code
Simple linear regression¶
A simple linear regression example with two model parameters and one noise parameter.
The model equation is y = a * x + b with a, b being the model parameters and the noise model is a normal zero-mean distribution with the std. deviation to infer. The problem is solved via sampling using emcee and pyro.
Import what we will need for this example.
import matplotlib.pyplot as plt
import numpy as np
from probeye.definition.forward_model import ForwardModelBase
from probeye.definition.inference_problem import InferenceProblem
from probeye.definition.noise_model import NormalNoiseModel
from probeye.definition.sensor import Sensor
from probeye.inference.emcee_.solver import EmceeSolver
We start by generating a synthetic data set from a known linear model. Later we will pretend to forgot about the parameters of this ground truth model and will try to recover them from the data. The slope and intercept of the ground truth model:
a_true = 2.5
b_true = 1.7
Generate a few data points that we contaminate with a Gaussian error:
n_tests = 50
seed = 1
np.random.seed(seed)
x_test = np.linspace(0.0, 1.0, n_tests)
y_true = a_true * x_test + b_true
sigma_noise = 0.5
y_test = y_true + np.random.normal(loc=0, scale=sigma_noise, size=n_tests)
Visualize our data points
plt.plot(x_test, y_test, "o")
plt.xlabel("x")
plt.ylabel("y")
plt.show()

Define our parametrized linear model:
class LinearModel(ForwardModelBase):
def response(self, inp):
# this method *must* be provided by the user
x = inp["x"]
m = inp["m"]
b = inp["b"]
response = {}
for os in self.output_sensors:
response[os.name] = m * x + b
return response
def jacobian(self, inp):
# this method *can* be provided by the user; if not provided
# the jacobian will be approximated by finite differences
x = inp["x"] # vector
one = np.ones((len(x), 1))
jacobian = {}
for os in self.output_sensors:
# partial derivatives must only be stated for the model
# parameters; all other input must be flagged by None;
# note: partial derivatives must be given as column vectors
jacobian[os.name] = {"x": None, "m": x.reshape(-1, 1), "b": one}
return jacobian
Define the inference problem. Initialize the inference problem with a useful name; note that the name will only be stored as an attribute of the InferenceProblem and is not important for the problem itself; can be useful when dealing with multiple problems
problem = InferenceProblem("Linear regression with normal noise")
Out:
2021-11-15 13:52:02.403 | INFO | # ================================================================================================ # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.404 | INFO | # # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.404 | INFO | # dP # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.404 | INFO | # 88 # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.404 | INFO | # 88d888b. 88d888b..d8888b. 88d888b. .d8888b. dP dP .d8888b. # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.405 | INFO | # 88' `88 88' 88' `88 88' `88 88ooood8 88 88 88ooood8 # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.405 | INFO | # 88. .88 88 88. .88 88. .88 88. 88. .88 88. # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.405 | INFO | # 88Y888P' dP `88888P' 88Y8888' `88888P' `8888P88 `88888P' # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.405 | INFO | # 88 .88 # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.405 | INFO | # dP d8888P # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.406 | INFO | # # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.406 | INFO | # ================================================================================================ # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.406 | INFO | # # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.406 | INFO | # Version 1.0.11 - A general framework for setting up parameter estimation problems. # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.406 | INFO | # # | probeye.subroutines:print_probeye_header:616
2021-11-15 13:52:02.406 | INFO | # ================================================================================================ # | probeye.subroutines:print_probeye_header:616
Add all parameters to the problem; the first argument states the parameter’s global name (here: ‘a’, ‘b’ and ‘sigma’); the second argument defines the parameter type (three options: ‘model’ for parameter’s of the forward model, ‘prior’ for prior parameters and ‘noise’ for parameters of the noise model); the ‘info’-argument is a short description string used for logging, and the tex-argument gives a tex-string of the parameter used for plotting; finally, the prior- argument specifies the parameter’s prior; note that this definition of a prior will result in the initialization of constant parameters of type ‘prior’ in the background
problem.add_parameter(
"a",
"model",
tex="$a$",
info="Slope of the graph",
prior=("normal", {"loc": 2.0, "scale": 1.0}),
)
problem.add_parameter(
"b",
"model",
info="Intersection of graph with y-axis",
tex="$b$",
prior=("normal", {"loc": 1.0, "scale": 1.0}),
)
problem.add_parameter(
"sigma",
"noise",
tex=r"$\sigma$",
info="Std. dev, of 0-mean noise model",
prior=("uniform", {"low": 0.1, "high": 0.8}),
)
Add the forward model to the problem; note that the first positional argument [{‘a’: ‘m’}, ‘b’] passed to LinearModel defines the forward model’s parameters by name via a list with elements structured like {<global parameter name>: <local parameter name>}; a global name is a name introduced by problem.add_parameter, while a local name is a name used in the response-method of the forward model class (see the class LinearModel above); note that the use of the local parameter name ‘m’ for the global parameter ‘a’ is added here only to highlight the possibility of this feature; it is not necessary at all here; whenever forward model’s parameter has a similar local and global name (which should be the case most of the times), one doesn’t have to use the verbose notation {<global parameter name>: <local parameter name>} but can instead just write the parameter’s (global=local) name, like it is done with the forward model’s parameter ‘b’ below
isensor = Sensor("x")
osensor = Sensor("y")
linear_model = LinearModel([{"a": "m"}, "b"], [isensor], [osensor])
problem.add_forward_model("LinearModel", linear_model)
# add the noise model to the problem
problem.add_noise_model(NormalNoiseModel(prms_def={"sigma": "std"}, sensors=osensor))
Add test data to the Inference Problem
problem.add_experiment(
"TestSeries_1",
fwd_model_name="LinearModel",
sensor_values={isensor.name: x_test, osensor.name: y_test},
)
# give problem overview
problem.info()
Out:
2021-11-15 13:52:02.413 | INFO | | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.413 | INFO | Problem summary: Linear regression with normal noise | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.413 | INFO | ==================================================== | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.414 | INFO | | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.414 | INFO | Forward models | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.414 | INFO | --------------------------------------------------------- | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.414 | INFO | Model name | Global parameters | Local parameters | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.414 | INFO | --------------+---------------------+-------------------- | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.414 | INFO | LinearModel | a, b | m, b | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.415 | INFO | | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.415 | INFO | Priors | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.415 | INFO | ----------------------------------------------------------------------------- | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.415 | INFO | Prior name | Global parameters | Local parameters | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.415 | INFO | ---------------+------------------------------+------------------------------ | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.415 | INFO | a_normal | a, loc_a, scale_a | a, loc_a, scale_a | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.416 | INFO | b_normal | b, loc_b, scale_b | b, loc_b, scale_b | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.416 | INFO | sigma_uniform | sigma, low_sigma, high_sigma | sigma, low_sigma, high_sigma | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.416 | INFO | | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.416 | INFO | Parameter overview | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.416 | INFO | ----------------------------------------------------------------------------------------- | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.416 | INFO | Parameter type/role | Parameter names | Count | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.417 | INFO | -----------------------+-------------------------------------------------------+--------- | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.417 | INFO | Model parameters | a, b | 2 | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.417 | INFO | Prior parameters | loc_a, scale_a, loc_b, scale_b, low_sigma, high_sigma | 6 | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.417 | INFO | Noise parameters | sigma | 1 | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.417 | INFO | Const parameters | loc_a, scale_a, loc_b, scale_b, low_sigma, high_sigma | 6 | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.417 | INFO | Latent parameters | a, b, sigma | 3 | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.418 | INFO | | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.418 | INFO | Parameter explanations | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.418 | INFO | --------------------------------------------------------------------- | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.418 | INFO | Name | Short explanation | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.418 | INFO | ------------+-------------------------------------------------------- | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.418 | INFO | loc_a | Normal prior's parameter for latent parameter 'a' | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.419 | INFO | scale_a | Normal prior's parameter for latent parameter 'a' | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.419 | INFO | a | Slope of the graph | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.419 | INFO | loc_b | Normal prior's parameter for latent parameter 'b' | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.419 | INFO | scale_b | Normal prior's parameter for latent parameter 'b' | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.419 | INFO | b | Intersection of graph with y-axis | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.419 | INFO | low_sigma | Uniform prior's parameter for latent parameter 'sigma' | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.420 | INFO | high_sigma | Uniform prior's parameter for latent parameter 'sigma' | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.420 | INFO | sigma | Std. dev, of 0-mean noise model | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.420 | INFO | | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.420 | INFO | Constant parameters | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.420 | INFO | ---------------------- | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.420 | INFO | Name | Value | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.421 | INFO | ------------+--------- | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.421 | INFO | loc_a | 2 | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.421 | INFO | scale_a | 1 | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.421 | INFO | loc_b | 1 | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.421 | INFO | scale_b | 1 | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.422 | INFO | low_sigma | 0.1 | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.422 | INFO | high_sigma | 0.8 | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.422 | INFO | | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.422 | INFO | Theta interpretation | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.422 | INFO | +---------------------------+ | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.422 | INFO | | Theta | Parameter | | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.423 | INFO | | index | name | | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.423 | INFO | |---------------------------| | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.423 | INFO | | 0 --> a | | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.423 | INFO | | 1 --> b | | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.423 | INFO | | 2 --> sigma | | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.423 | INFO | +---------------------------+ | probeye.definition.inference_problem:info:267
2021-11-15 13:52:02.424 | INFO | | probeye.definition.inference_problem:info:267
"\nProblem summary: Linear regression with normal noise\n====================================================\n\nForward models\n---------------------------------------------------------\n Model name | Global parameters | Local parameters\n--------------+---------------------+--------------------\n LinearModel | a, b | m, b\n\nPriors\n-----------------------------------------------------------------------------\n Prior name | Global parameters | Local parameters\n---------------+------------------------------+------------------------------\n a_normal | a, loc_a, scale_a | a, loc_a, scale_a\n b_normal | b, loc_b, scale_b | b, loc_b, scale_b\n sigma_uniform | sigma, low_sigma, high_sigma | sigma, low_sigma, high_sigma\n\nParameter overview\n-----------------------------------------------------------------------------------------\n Parameter type/role | Parameter names | Count\n-----------------------+-------------------------------------------------------+---------\n Model parameters | a, b | 2\n Prior parameters | loc_a, scale_a, loc_b, scale_b, low_sigma, high_sigma | 6\n Noise parameters | sigma | 1\n Const parameters | loc_a, scale_a, loc_b, scale_b, low_sigma, high_sigma | 6\n Latent parameters | a, b, sigma | 3\n\nParameter explanations\n---------------------------------------------------------------------\n Name | Short explanation\n------------+--------------------------------------------------------\n loc_a | Normal prior's parameter for latent parameter 'a'\n scale_a | Normal prior's parameter for latent parameter 'a'\n a | Slope of the graph\n loc_b | Normal prior's parameter for latent parameter 'b'\n scale_b | Normal prior's parameter for latent parameter 'b'\n b | Intersection of graph with y-axis\n low_sigma | Uniform prior's parameter for latent parameter 'sigma'\n high_sigma | Uniform prior's parameter for latent parameter 'sigma'\n sigma | Std. dev, of 0-mean noise model\n\nConstant parameters\n----------------------\n Name | Value\n------------+---------\n loc_a | 2\n scale_a | 1\n loc_b | 1\n scale_b | 1\n low_sigma | 0.1\n high_sigma | 0.8\n\nTheta interpretation\n+---------------------------+\n| Theta | Parameter |\n| index | name |\n|---------------------------|\n| 0 --> a |\n| 1 --> b |\n| 2 --> sigma |\n+---------------------------+\n"
Estimate the parameters using emcee
emcee_solver = EmceeSolver(problem, show_progress=True)
inference_data = emcee_solver.run_mcmc(n_walkers=20, n_steps=2_000, n_initial_steps=200)
Out:
2021-11-15 13:52:02.426 | INFO | Solving problem using emcee sampler with 200 + 2000 samples and 20 walkers | probeye.inference.emcee_.solver:run_mcmc:113
2021-11-15 13:52:02.426 | INFO | No additional options specified | probeye.inference.emcee_.solver:run_mcmc:120
0%| | 0/200 [00:00<?, ?it/s]
4%|3 | 7/200 [00:00<00:02, 65.78it/s]
7%|7 | 14/200 [00:00<00:02, 65.85it/s]
10%|# | 21/200 [00:00<00:02, 66.39it/s]
14%|#4 | 28/200 [00:00<00:02, 66.77it/s]
18%|#7 | 35/200 [00:00<00:02, 66.82it/s]
21%|##1 | 42/200 [00:00<00:02, 66.93it/s]
24%|##4 | 49/200 [00:00<00:02, 67.04it/s]
28%|##8 | 56/200 [00:00<00:02, 67.17it/s]
32%|###1 | 63/200 [00:00<00:02, 67.14it/s]
35%|###5 | 70/200 [00:01<00:01, 67.25it/s]
38%|###8 | 77/200 [00:01<00:01, 67.33it/s]
42%|####2 | 84/200 [00:01<00:01, 67.31it/s]
46%|####5 | 91/200 [00:01<00:01, 67.33it/s]
49%|####9 | 98/200 [00:01<00:01, 67.38it/s]
52%|#####2 | 105/200 [00:01<00:01, 67.39it/s]
56%|#####6 | 112/200 [00:01<00:01, 67.40it/s]
60%|#####9 | 119/200 [00:01<00:01, 67.29it/s]
63%|######3 | 126/200 [00:01<00:01, 67.39it/s]
66%|######6 | 133/200 [00:01<00:00, 67.32it/s]
70%|####### | 140/200 [00:02<00:00, 67.40it/s]
74%|#######3 | 147/200 [00:02<00:00, 67.41it/s]
77%|#######7 | 154/200 [00:02<00:00, 67.48it/s]
80%|######## | 161/200 [00:02<00:00, 67.57it/s]
84%|########4 | 168/200 [00:02<00:00, 67.36it/s]
88%|########7 | 175/200 [00:02<00:00, 67.40it/s]
91%|#########1| 182/200 [00:02<00:00, 67.44it/s]
94%|#########4| 189/200 [00:02<00:00, 67.42it/s]
98%|#########8| 196/200 [00:02<00:00, 67.49it/s]
100%|##########| 200/200 [00:02<00:00, 67.25it/s]
0%| | 0/2000 [00:00<?, ?it/s]
0%| | 7/2000 [00:00<00:29, 68.26it/s]
1%| | 14/2000 [00:00<00:29, 68.10it/s]
1%|1 | 21/2000 [00:00<00:29, 68.09it/s]
1%|1 | 28/2000 [00:00<00:28, 68.03it/s]
2%|1 | 35/2000 [00:00<00:28, 67.96it/s]
2%|2 | 42/2000 [00:00<00:28, 67.99it/s]
2%|2 | 49/2000 [00:00<00:28, 67.90it/s]
3%|2 | 56/2000 [00:00<00:28, 67.92it/s]
3%|3 | 63/2000 [00:00<00:28, 67.93it/s]
4%|3 | 70/2000 [00:01<00:28, 67.90it/s]
4%|3 | 77/2000 [00:01<00:28, 67.90it/s]
4%|4 | 84/2000 [00:01<00:28, 67.94it/s]
5%|4 | 91/2000 [00:01<00:28, 68.00it/s]
5%|4 | 98/2000 [00:01<00:27, 68.00it/s]
5%|5 | 105/2000 [00:01<00:27, 67.81it/s]
6%|5 | 112/2000 [00:01<00:27, 67.56it/s]
6%|5 | 119/2000 [00:01<00:27, 67.69it/s]
6%|6 | 126/2000 [00:01<00:27, 67.74it/s]
7%|6 | 133/2000 [00:01<00:27, 67.77it/s]
7%|7 | 140/2000 [00:02<00:27, 67.88it/s]
7%|7 | 147/2000 [00:02<00:27, 67.86it/s]
8%|7 | 154/2000 [00:02<00:27, 67.90it/s]
8%|8 | 161/2000 [00:02<00:27, 67.89it/s]
8%|8 | 168/2000 [00:02<00:26, 67.91it/s]
9%|8 | 175/2000 [00:02<00:26, 67.91it/s]
9%|9 | 182/2000 [00:02<00:26, 67.96it/s]
9%|9 | 189/2000 [00:02<00:26, 67.85it/s]
10%|9 | 196/2000 [00:02<00:26, 67.93it/s]
10%|# | 203/2000 [00:02<00:26, 67.97it/s]
10%|# | 210/2000 [00:03<00:26, 67.96it/s]
11%|# | 217/2000 [00:03<00:26, 68.01it/s]
11%|#1 | 224/2000 [00:03<00:26, 67.90it/s]
12%|#1 | 231/2000 [00:03<00:26, 67.91it/s]
12%|#1 | 238/2000 [00:03<00:25, 67.86it/s]
12%|#2 | 245/2000 [00:03<00:25, 67.84it/s]
13%|#2 | 252/2000 [00:03<00:25, 67.89it/s]
13%|#2 | 259/2000 [00:03<00:25, 67.90it/s]
13%|#3 | 266/2000 [00:03<00:25, 67.89it/s]
14%|#3 | 273/2000 [00:04<00:25, 67.94it/s]
14%|#4 | 280/2000 [00:04<00:25, 67.87it/s]
14%|#4 | 287/2000 [00:04<00:25, 67.93it/s]
15%|#4 | 294/2000 [00:04<00:25, 67.99it/s]
15%|#5 | 301/2000 [00:04<00:24, 67.99it/s]
15%|#5 | 308/2000 [00:04<00:24, 67.94it/s]
16%|#5 | 315/2000 [00:04<00:24, 67.99it/s]
16%|#6 | 322/2000 [00:04<00:24, 68.04it/s]
16%|#6 | 329/2000 [00:04<00:24, 68.13it/s]
17%|#6 | 336/2000 [00:04<00:24, 68.17it/s]
17%|#7 | 343/2000 [00:05<00:24, 68.22it/s]
18%|#7 | 350/2000 [00:05<00:24, 68.20it/s]
18%|#7 | 357/2000 [00:05<00:24, 68.24it/s]
18%|#8 | 364/2000 [00:05<00:23, 68.33it/s]
19%|#8 | 371/2000 [00:05<00:23, 68.30it/s]
19%|#8 | 378/2000 [00:05<00:23, 68.20it/s]
19%|#9 | 385/2000 [00:05<00:23, 68.29it/s]
20%|#9 | 392/2000 [00:05<00:23, 68.34it/s]
20%|#9 | 399/2000 [00:05<00:23, 68.25it/s]
20%|## | 406/2000 [00:05<00:23, 68.25it/s]
21%|## | 413/2000 [00:06<00:23, 68.35it/s]
21%|##1 | 420/2000 [00:06<00:23, 68.37it/s]
21%|##1 | 427/2000 [00:06<00:23, 68.33it/s]
22%|##1 | 434/2000 [00:06<00:22, 68.37it/s]
22%|##2 | 441/2000 [00:06<00:22, 68.36it/s]
22%|##2 | 448/2000 [00:06<00:22, 68.35it/s]
23%|##2 | 455/2000 [00:06<00:22, 68.34it/s]
23%|##3 | 462/2000 [00:06<00:22, 68.27it/s]
23%|##3 | 469/2000 [00:06<00:22, 68.34it/s]
24%|##3 | 476/2000 [00:06<00:22, 68.32it/s]
24%|##4 | 483/2000 [00:07<00:22, 68.30it/s]
24%|##4 | 490/2000 [00:07<00:22, 68.24it/s]
25%|##4 | 497/2000 [00:07<00:22, 68.29it/s]
25%|##5 | 504/2000 [00:07<00:21, 68.37it/s]
26%|##5 | 511/2000 [00:07<00:21, 68.31it/s]
26%|##5 | 518/2000 [00:07<00:21, 68.26it/s]
26%|##6 | 525/2000 [00:07<00:21, 68.32it/s]
27%|##6 | 532/2000 [00:07<00:21, 68.31it/s]
27%|##6 | 539/2000 [00:07<00:21, 68.30it/s]
27%|##7 | 546/2000 [00:08<00:21, 68.31it/s]
28%|##7 | 553/2000 [00:08<00:21, 68.20it/s]
28%|##8 | 560/2000 [00:08<00:21, 67.95it/s]
28%|##8 | 567/2000 [00:08<00:21, 68.09it/s]
29%|##8 | 574/2000 [00:08<00:20, 68.15it/s]
29%|##9 | 581/2000 [00:08<00:20, 68.13it/s]
29%|##9 | 588/2000 [00:08<00:20, 68.23it/s]
30%|##9 | 595/2000 [00:08<00:20, 68.22it/s]
30%|### | 602/2000 [00:08<00:20, 68.22it/s]
30%|### | 609/2000 [00:08<00:21, 65.10it/s]
31%|### | 616/2000 [00:09<00:22, 62.66it/s]
31%|###1 | 623/2000 [00:09<00:21, 64.28it/s]
32%|###1 | 630/2000 [00:09<00:20, 65.37it/s]
32%|###1 | 637/2000 [00:09<00:20, 66.32it/s]
32%|###2 | 644/2000 [00:09<00:20, 66.89it/s]
33%|###2 | 651/2000 [00:09<00:20, 67.17it/s]
33%|###2 | 658/2000 [00:09<00:19, 67.48it/s]
33%|###3 | 665/2000 [00:09<00:19, 67.74it/s]
34%|###3 | 672/2000 [00:09<00:19, 67.83it/s]
34%|###3 | 679/2000 [00:10<00:19, 68.00it/s]
34%|###4 | 686/2000 [00:10<00:19, 68.09it/s]
35%|###4 | 693/2000 [00:10<00:19, 68.23it/s]
35%|###5 | 700/2000 [00:10<00:19, 68.26it/s]
35%|###5 | 707/2000 [00:10<00:18, 68.32it/s]
36%|###5 | 714/2000 [00:10<00:18, 68.36it/s]
36%|###6 | 721/2000 [00:10<00:18, 68.32it/s]
36%|###6 | 728/2000 [00:10<00:18, 68.38it/s]
37%|###6 | 735/2000 [00:10<00:18, 68.28it/s]
37%|###7 | 742/2000 [00:10<00:18, 68.35it/s]
37%|###7 | 749/2000 [00:11<00:18, 68.35it/s]
38%|###7 | 756/2000 [00:11<00:18, 68.37it/s]
38%|###8 | 763/2000 [00:11<00:18, 68.39it/s]
38%|###8 | 770/2000 [00:11<00:17, 68.44it/s]
39%|###8 | 777/2000 [00:11<00:17, 68.42it/s]
39%|###9 | 784/2000 [00:11<00:17, 68.35it/s]
40%|###9 | 791/2000 [00:11<00:17, 68.41it/s]
40%|###9 | 798/2000 [00:11<00:17, 68.49it/s]
40%|#### | 805/2000 [00:11<00:17, 68.44it/s]
41%|#### | 812/2000 [00:11<00:17, 68.40it/s]
41%|#### | 819/2000 [00:12<00:17, 68.44it/s]
41%|####1 | 826/2000 [00:12<00:17, 68.42it/s]
42%|####1 | 833/2000 [00:12<00:17, 68.46it/s]
42%|####2 | 840/2000 [00:12<00:16, 68.49it/s]
42%|####2 | 847/2000 [00:12<00:16, 68.50it/s]
43%|####2 | 854/2000 [00:12<00:16, 68.44it/s]
43%|####3 | 861/2000 [00:12<00:16, 68.45it/s]
43%|####3 | 868/2000 [00:12<00:16, 68.29it/s]
44%|####3 | 875/2000 [00:12<00:16, 68.35it/s]
44%|####4 | 882/2000 [00:12<00:16, 68.40it/s]
44%|####4 | 889/2000 [00:13<00:16, 68.47it/s]
45%|####4 | 896/2000 [00:13<00:16, 68.51it/s]
45%|####5 | 903/2000 [00:13<00:16, 68.52it/s]
46%|####5 | 910/2000 [00:13<00:15, 68.49it/s]
46%|####5 | 917/2000 [00:13<00:15, 68.54it/s]
46%|####6 | 924/2000 [00:13<00:15, 68.45it/s]
47%|####6 | 931/2000 [00:13<00:15, 68.45it/s]
47%|####6 | 938/2000 [00:13<00:15, 68.47it/s]
47%|####7 | 945/2000 [00:13<00:15, 68.50it/s]
48%|####7 | 952/2000 [00:13<00:15, 68.50it/s]
48%|####7 | 959/2000 [00:14<00:15, 68.57it/s]
48%|####8 | 966/2000 [00:14<00:15, 68.42it/s]
49%|####8 | 973/2000 [00:14<00:15, 64.80it/s]
49%|####9 | 980/2000 [00:14<00:17, 59.35it/s]
49%|####9 | 987/2000 [00:14<00:16, 61.80it/s]
50%|####9 | 994/2000 [00:14<00:15, 63.68it/s]
50%|##### | 1001/2000 [00:14<00:15, 64.98it/s]
50%|##### | 1008/2000 [00:14<00:15, 66.01it/s]
51%|##### | 1015/2000 [00:14<00:14, 66.78it/s]
51%|#####1 | 1022/2000 [00:15<00:14, 67.34it/s]
51%|#####1 | 1029/2000 [00:15<00:14, 67.70it/s]
52%|#####1 | 1036/2000 [00:15<00:14, 67.91it/s]
52%|#####2 | 1043/2000 [00:15<00:14, 68.14it/s]
52%|#####2 | 1050/2000 [00:15<00:13, 68.30it/s]
53%|#####2 | 1057/2000 [00:15<00:13, 68.22it/s]
53%|#####3 | 1064/2000 [00:15<00:13, 68.27it/s]
54%|#####3 | 1071/2000 [00:15<00:13, 68.30it/s]
54%|#####3 | 1078/2000 [00:15<00:13, 68.32it/s]
54%|#####4 | 1085/2000 [00:15<00:13, 68.39it/s]
55%|#####4 | 1092/2000 [00:16<00:13, 68.37it/s]
55%|#####4 | 1099/2000 [00:16<00:13, 68.33it/s]
55%|#####5 | 1106/2000 [00:16<00:13, 68.36it/s]
56%|#####5 | 1113/2000 [00:16<00:12, 68.37it/s]
56%|#####6 | 1120/2000 [00:16<00:12, 68.39it/s]
56%|#####6 | 1127/2000 [00:16<00:12, 68.27it/s]
57%|#####6 | 1134/2000 [00:16<00:12, 68.33it/s]
57%|#####7 | 1141/2000 [00:16<00:12, 68.27it/s]
57%|#####7 | 1148/2000 [00:16<00:12, 68.24it/s]
58%|#####7 | 1155/2000 [00:17<00:12, 68.25it/s]
58%|#####8 | 1162/2000 [00:17<00:12, 67.51it/s]
58%|#####8 | 1169/2000 [00:17<00:12, 66.37it/s]
59%|#####8 | 1176/2000 [00:17<00:12, 66.51it/s]
59%|#####9 | 1183/2000 [00:17<00:12, 66.62it/s]
60%|#####9 | 1190/2000 [00:17<00:12, 67.07it/s]
60%|#####9 | 1197/2000 [00:17<00:11, 67.50it/s]
60%|###### | 1204/2000 [00:17<00:11, 67.77it/s]
61%|###### | 1211/2000 [00:17<00:11, 67.83it/s]
61%|###### | 1218/2000 [00:17<00:11, 67.92it/s]
61%|######1 | 1225/2000 [00:18<00:11, 68.13it/s]
62%|######1 | 1232/2000 [00:18<00:11, 67.37it/s]
62%|######1 | 1239/2000 [00:18<00:11, 67.63it/s]
62%|######2 | 1246/2000 [00:18<00:11, 67.93it/s]
63%|######2 | 1253/2000 [00:18<00:10, 68.05it/s]
63%|######3 | 1260/2000 [00:18<00:10, 68.16it/s]
63%|######3 | 1267/2000 [00:18<00:10, 68.22it/s]
64%|######3 | 1274/2000 [00:18<00:10, 68.18it/s]
64%|######4 | 1281/2000 [00:18<00:10, 68.23it/s]
64%|######4 | 1288/2000 [00:18<00:10, 68.31it/s]
65%|######4 | 1295/2000 [00:19<00:10, 68.39it/s]
65%|######5 | 1302/2000 [00:19<00:10, 68.30it/s]
65%|######5 | 1309/2000 [00:19<00:10, 68.34it/s]
66%|######5 | 1316/2000 [00:19<00:10, 68.36it/s]
66%|######6 | 1323/2000 [00:19<00:09, 68.26it/s]
66%|######6 | 1330/2000 [00:19<00:09, 68.17it/s]
67%|######6 | 1337/2000 [00:19<00:10, 63.04it/s]
67%|######7 | 1344/2000 [00:19<00:10, 61.81it/s]
68%|######7 | 1351/2000 [00:19<00:10, 63.30it/s]
68%|######7 | 1358/2000 [00:20<00:09, 64.98it/s]
68%|######8 | 1365/2000 [00:20<00:09, 66.09it/s]
69%|######8 | 1372/2000 [00:20<00:09, 66.77it/s]
69%|######8 | 1379/2000 [00:20<00:09, 67.33it/s]
69%|######9 | 1386/2000 [00:20<00:09, 67.70it/s]
70%|######9 | 1393/2000 [00:20<00:08, 67.89it/s]
70%|####### | 1400/2000 [00:20<00:08, 68.15it/s]
70%|####### | 1407/2000 [00:20<00:08, 68.17it/s]
71%|####### | 1414/2000 [00:20<00:08, 68.28it/s]
71%|#######1 | 1421/2000 [00:20<00:08, 68.39it/s]
71%|#######1 | 1428/2000 [00:21<00:08, 68.48it/s]
72%|#######1 | 1435/2000 [00:21<00:08, 68.45it/s]
72%|#######2 | 1442/2000 [00:21<00:08, 68.46it/s]
72%|#######2 | 1449/2000 [00:21<00:08, 68.50it/s]
73%|#######2 | 1456/2000 [00:21<00:07, 68.49it/s]
73%|#######3 | 1463/2000 [00:21<00:07, 68.35it/s]
74%|#######3 | 1470/2000 [00:21<00:07, 68.41it/s]
74%|#######3 | 1477/2000 [00:21<00:07, 68.47it/s]
74%|#######4 | 1484/2000 [00:21<00:07, 68.41it/s]
75%|#######4 | 1491/2000 [00:21<00:07, 68.39it/s]
75%|#######4 | 1498/2000 [00:22<00:07, 68.39it/s]
75%|#######5 | 1505/2000 [00:22<00:07, 68.36it/s]
76%|#######5 | 1512/2000 [00:22<00:07, 68.39it/s]
76%|#######5 | 1519/2000 [00:22<00:07, 68.35it/s]
76%|#######6 | 1526/2000 [00:22<00:06, 68.31it/s]
77%|#######6 | 1533/2000 [00:22<00:06, 68.32it/s]
77%|#######7 | 1540/2000 [00:22<00:06, 68.37it/s]
77%|#######7 | 1547/2000 [00:22<00:06, 68.37it/s]
78%|#######7 | 1554/2000 [00:22<00:06, 68.41it/s]
78%|#######8 | 1561/2000 [00:23<00:06, 68.45it/s]
78%|#######8 | 1568/2000 [00:23<00:06, 68.48it/s]
79%|#######8 | 1575/2000 [00:23<00:06, 68.49it/s]
79%|#######9 | 1582/2000 [00:23<00:06, 68.44it/s]
79%|#######9 | 1589/2000 [00:23<00:06, 68.35it/s]
80%|#######9 | 1596/2000 [00:23<00:05, 68.32it/s]
80%|######## | 1603/2000 [00:23<00:05, 68.42it/s]
80%|######## | 1610/2000 [00:23<00:05, 68.52it/s]
81%|######## | 1617/2000 [00:23<00:05, 68.44it/s]
81%|########1 | 1624/2000 [00:23<00:05, 68.39it/s]
82%|########1 | 1631/2000 [00:24<00:05, 68.43it/s]
82%|########1 | 1638/2000 [00:24<00:05, 68.45it/s]
82%|########2 | 1645/2000 [00:24<00:05, 68.48it/s]
83%|########2 | 1652/2000 [00:24<00:05, 68.40it/s]
83%|########2 | 1659/2000 [00:24<00:04, 68.41it/s]
83%|########3 | 1666/2000 [00:24<00:04, 68.40it/s]
84%|########3 | 1673/2000 [00:24<00:04, 68.35it/s]
84%|########4 | 1680/2000 [00:24<00:04, 68.30it/s]
84%|########4 | 1687/2000 [00:24<00:04, 68.36it/s]
85%|########4 | 1694/2000 [00:24<00:04, 68.43it/s]
85%|########5 | 1701/2000 [00:25<00:04, 68.46it/s]
85%|########5 | 1708/2000 [00:25<00:04, 68.42it/s]
86%|########5 | 1715/2000 [00:25<00:04, 68.41it/s]
86%|########6 | 1722/2000 [00:25<00:04, 68.46it/s]
86%|########6 | 1729/2000 [00:25<00:03, 68.51it/s]
87%|########6 | 1736/2000 [00:25<00:03, 68.41it/s]
87%|########7 | 1743/2000 [00:25<00:03, 68.36it/s]
88%|########7 | 1750/2000 [00:25<00:03, 68.41it/s]
88%|########7 | 1757/2000 [00:25<00:03, 68.37it/s]
88%|########8 | 1764/2000 [00:25<00:03, 68.31it/s]
89%|########8 | 1771/2000 [00:26<00:03, 68.35it/s]
89%|########8 | 1778/2000 [00:26<00:03, 68.31it/s]
89%|########9 | 1785/2000 [00:26<00:03, 68.37it/s]
90%|########9 | 1792/2000 [00:26<00:03, 68.46it/s]
90%|########9 | 1799/2000 [00:26<00:02, 68.43it/s]
90%|######### | 1806/2000 [00:26<00:02, 68.44it/s]
91%|######### | 1813/2000 [00:26<00:02, 68.45it/s]
91%|#########1| 1820/2000 [00:26<00:02, 68.38it/s]
91%|#########1| 1827/2000 [00:26<00:02, 68.42it/s]
92%|#########1| 1834/2000 [00:27<00:02, 68.45it/s]
92%|#########2| 1841/2000 [00:27<00:02, 68.45it/s]
92%|#########2| 1848/2000 [00:27<00:02, 68.42it/s]
93%|#########2| 1855/2000 [00:27<00:02, 68.48it/s]
93%|#########3| 1862/2000 [00:27<00:02, 68.49it/s]
93%|#########3| 1869/2000 [00:27<00:01, 68.39it/s]
94%|#########3| 1876/2000 [00:27<00:01, 68.36it/s]
94%|#########4| 1883/2000 [00:27<00:01, 68.44it/s]
94%|#########4| 1890/2000 [00:27<00:01, 68.28it/s]
95%|#########4| 1897/2000 [00:27<00:01, 68.30it/s]
95%|#########5| 1904/2000 [00:28<00:01, 68.38it/s]
96%|#########5| 1911/2000 [00:28<00:01, 67.98it/s]
96%|#########5| 1918/2000 [00:28<00:01, 68.11it/s]
96%|#########6| 1925/2000 [00:28<00:01, 68.18it/s]
97%|#########6| 1932/2000 [00:28<00:00, 68.25it/s]
97%|#########6| 1939/2000 [00:28<00:00, 68.26it/s]
97%|#########7| 1946/2000 [00:28<00:00, 68.33it/s]
98%|#########7| 1953/2000 [00:28<00:00, 68.30it/s]
98%|#########8| 1960/2000 [00:28<00:00, 68.38it/s]
98%|#########8| 1967/2000 [00:28<00:00, 68.40it/s]
99%|#########8| 1974/2000 [00:29<00:00, 68.42it/s]
99%|#########9| 1981/2000 [00:29<00:00, 68.36it/s]
99%|#########9| 1988/2000 [00:29<00:00, 68.33it/s]
100%|#########9| 1995/2000 [00:29<00:00, 68.34it/s]
100%|##########| 2000/2000 [00:29<00:00, 67.93it/s]
2021-11-15 13:52:34.866 | INFO | Sampling of the posterior distribution completed: 2000 steps and 20 walkers. | probeye.inference.emcee_.solver:run_mcmc:175
2021-11-15 13:52:34.866 | INFO | Total run-time (including initial sampling): 32s. | probeye.inference.emcee_.solver:run_mcmc:178
2021-11-15 13:52:34.866 | INFO | | probeye.inference.emcee_.solver:run_mcmc:180
2021-11-15 13:52:34.866 | INFO | Summary of sampling results | probeye.inference.emcee_.solver:run_mcmc:181
2021-11-15 13:52:34.877 | INFO | mean median sd 5% 95% | probeye.inference.emcee_.solver:emcee_summary:82
2021-11-15 13:52:34.877 | INFO | ----- ------ -------- ---- ---- ----- | probeye.inference.emcee_.solver:emcee_summary:82
2021-11-15 13:52:34.877 | INFO | a 2.68 2.68 0.23 2.30 3.07 | probeye.inference.emcee_.solver:emcee_summary:82
2021-11-15 13:52:34.877 | INFO | b 1.60 1.60 0.14 1.37 1.82 | probeye.inference.emcee_.solver:emcee_summary:82
2021-11-15 13:52:34.878 | INFO | sigma 0.50 0.50 0.05 0.42 0.60 | probeye.inference.emcee_.solver:emcee_summary:82
Total running time of the script: ( 0 minutes 32.715 seconds)