copyright Gerd Wuebbeler, Manuel Marschall (PTB) 2020
This software is licensed under the BSD-like license:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
This software was developed at Physikalisch-Technische Bundesanstalt (PTB). The software is made available "as is" free of cost. PTB assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, safety, suitability or any other characteristic. In no event will PTB be liable for any direct, indirect or consequential damage arising in connection
Using this software in publications requires citing the following Paper: https://doi.org/10.1088/1681-7575/aba3b8 '''
This repository contains the python code provided in the paper "A simple method for Bayesian uncertainty evaluation in linear models".
The paper provides a simple and easy method to employ the Bayesian paradigm for typical applications in metrology. The suggested choice for the prior, the sampling methods and the analysis of the resulting posterior is covered in this repository.
Installation and running the code
To run the script one needs a $\geq$ python 3.6 installation with the default packages
Installation guides for Linux, Windows and Mac can be found here: https://realpython.com/installing-python/
Quick guide for Windows:
Download Python https://www.python.org/downloads/release/python-382/ (bottom of the page: "Windows x86-64 executable installer")
Install Python using the installer and check "Add Python x.x to Path"
Run a terminal, e.g. CMD
Check the installation by typing
a command prompt should appear such as
C:\Users\Marschall\Projects\simple_bayes>python Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
Close the Python prompt using
python -m pip install numpy scipy matplotlib
Navigate to downloaded or cloned files of the repo using
Run the example program
generic_example.py contain the examples from the paper and the main functionality is provided in the
Here, most of the routines are collected and called from the script files.
In the directories
generic/ we provide the corresponding measurements and samples of B to repeat the experiments from the paper.
In case of problems or questions please contact