diff --git a/docs/pyerrors/fits.html b/docs/pyerrors/fits.html index 750d4bc3..4380c5a7 100644 --- a/docs/pyerrors/fits.html +++ b/docs/pyerrors/fits.html @@ -89,9 +89,6 @@
import gc -from collections.abc import Sequence +@@ -1660,73 +1610,6 @@ check if the residuals of the fit are gaussian distributed.from collections.abc import Sequence import warnings import numpy as np import autograd.numpy as anp @@ -852,52 +848,6 @@ err = np.array(err) return err - - -def ks_test(obs=None): - """Performs a Kolmogorov–Smirnov test for the Q-values of all fit object. - - If no list is given all Obs in memory are used. - - Disclaimer: The determination of the individual Q-values as well as this function have not been tested yet. - """ - - raise Exception('Not yet implemented') - - if obs is None: - obs_list = [] - for obj in gc.get_objects(): - if isinstance(obj, Obs): - obs_list.append(obj) - else: - obs_list = obs - - # TODO: Rework to apply to Q-values of all fits in memory - Qs = [] - for obs_i in obs_list: - for ens in obs_i.e_names: - if obs_i.e_Q[ens] is not None: - Qs.append(obs_i.e_Q[ens]) - - bins = len(Qs) - x = np.arange(0, 1.001, 0.001) - plt.plot(x, x, 'k', zorder=1) - plt.xlim(0, 1) - plt.ylim(0, 1) - plt.xlabel('Q value') - plt.ylabel('Cumulative probability') - plt.title(str(bins) + ' Q values') - - n = np.arange(1, bins + 1) / np.float64(bins) - Xs = np.sort(Qs) - plt.step(Xs, n) - diffs = n - Xs - loc_max_diff = np.argmax(np.abs(diffs)) - loc = Xs[loc_max_diff] - plt.annotate(s='', xy=(loc, loc), xytext=(loc, loc + diffs[loc_max_diff]), arrowprops=dict(arrowstyle='<->', shrinkA=0, shrinkB=0)) - plt.draw() - - print(scipy.stats.kstest(Qs, 'uniform'))
def ks_test(obs=None): - """Performs a Kolmogorov–Smirnov test for the Q-values of all fit object. - - If no list is given all Obs in memory are used. - - Disclaimer: The determination of the individual Q-values as well as this function have not been tested yet. - """ - - raise Exception('Not yet implemented') - - if obs is None: - obs_list = [] - for obj in gc.get_objects(): - if isinstance(obj, Obs): - obs_list.append(obj) - else: - obs_list = obs - - # TODO: Rework to apply to Q-values of all fits in memory - Qs = [] - for obs_i in obs_list: - for ens in obs_i.e_names: - if obs_i.e_Q[ens] is not None: - Qs.append(obs_i.e_Q[ens]) - - bins = len(Qs) - x = np.arange(0, 1.001, 0.001) - plt.plot(x, x, 'k', zorder=1) - plt.xlim(0, 1) - plt.ylim(0, 1) - plt.xlabel('Q value') - plt.ylabel('Cumulative probability') - plt.title(str(bins) + ' Q values') - - n = np.arange(1, bins + 1) / np.float64(bins) - Xs = np.sort(Qs) - plt.step(Xs, n) - diffs = n - Xs - loc_max_diff = np.argmax(np.abs(diffs)) - loc = Xs[loc_max_diff] - plt.annotate(s='', xy=(loc, loc), xytext=(loc, loc + diffs[loc_max_diff]), arrowprops=dict(arrowstyle='<->', shrinkA=0, shrinkB=0)) - plt.draw() - - print(scipy.stats.kstest(Qs, 'uniform')) -
Performs a Kolmogorov–Smirnov test for the Q-values of all fit object.
- -If no list is given all Obs in memory are used.
- -Disclaimer: The determination of the individual Q-values as well as this function have not been tested yet.
-