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.
Project description
License
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.
DISCLAIMER
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".
Motivation
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
- numpy
- scipy
- matplotlib
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
python
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
exit()
-
Install dependencies
python -m pip install numpy scipy matplotlib
-
Navigate to downloaded or cloned files of the repo using
cd
-
Run the example program
python generic_example.py
or
python mass_example.py
Implementation details
The files mass_example.py
and generic_example.py
contain the examples from the paper and the main functionality is provided in the bayes_uncertainty_util.py
package.
Here, most of the routines are collected and called from the script files.
In the directories mass/
and generic/
we provide the corresponding measurements and samples of B to repeat the experiments from the paper.
Contact
In case of problems or questions please contact manuel.marschall@ptb.de
or gerd.wuebbeler@ptb.de
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for simplebayesuncertainty-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f40def859f75a5d958ed1e934e63a196aa0e65b6020fce33f47b8bd04c2b6fca |
|
MD5 | 53019f39cf18e6b89706eaa71421e8d8 |
|
BLAKE2b-256 | 6e89e899a8a4b8f24e2ab9394d1d8df94ea423dc207926aacd561719e1f37cf2 |
Hashes for simplebayesuncertainty-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e9452dfcda393a96c58794dc2afa8c6731f98072765aecde497dbfac276ab55 |
|
MD5 | 60965e01f0e2872315c5343b9a3c18db |
|
BLAKE2b-256 | 5bdae2b23f9d8b26f7b1a67cf706413a08b8215e4415f54cea30e998a73495b6 |