From 0918330f13c91b2bc4c250b2909159124ce3682e Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Mon, 17 Jan 2022 14:55:14 +0000 Subject: [PATCH] feat: p-values added to skew and kurtosis in Obs.plot_history --- pyerrors/obs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyerrors/obs.py b/pyerrors/obs.py index 546a0a2e..0c2d3844 100644 --- a/pyerrors/obs.py +++ b/pyerrors/obs.py @@ -4,7 +4,7 @@ import numpy as np import autograd.numpy as anp # Thinly-wrapped numpy from autograd import jacobian import matplotlib.pyplot as plt -from scipy.stats import kurtosis, skew +from scipy.stats import skew, skewtest, kurtosis, kurtosistest import numdifftools as nd from itertools import groupby from .covobs import Covobs @@ -565,7 +565,7 @@ class Obs: y = np.concatenate(tmp, axis=0) plt.errorbar(x, y, fmt='.', markersize=3) plt.xlim(-0.5, e_N - 0.5) - plt.title(e_name + f', skew: {skew(y):2.3f}, kurtosis: {kurtosis(y):2.3f}') + plt.title(e_name + f', skew: {skew(y):.3f} (p={skewtest(y).pvalue:.2f}), kurtosis: {kurtosis(y):.3f} (p={kurtosistest(y).pvalue:.2f})') plt.draw() def plot_piechart(self):