Asymmetric uncertainties in measurements: SOAD a Python package based on Monte Carlo Simulations
https://aip.scitation.org/doi/abs/10.1063/1.5135421
という論文があったので使ってみた。数学的に正しいかどうかは確認していない
Gitでcloneする
git clone https://github.com/kiyami/soad.git cd soad
python setup.py install
でインストールだが、README.mdがUTF-8で記述されてるのにエンコーディングが設定されていないので、setup.py
の5行目を以下のように変更する
#with open("README.md", "r") as fh: with open("README.md", "r", encoding="utf-8") as fh:
インストール
python setup.py install
サンプルコードを実行してみる
from soad import AsymmetricData as asyd a = asyd(10.0, 1.0, 1.2, N=10000, confidence=1.0) b = asyd(15.0, 2.4, 2.1, N=10000, confidence=1.0) c = a * b print(c) c.plot_data_and_pdf(show=True, save=False) c.plot_log_likelihood(show=True, save=False)
出てくる絵は次の通り