From 0b158f87316f8b663fde879284cae01d4f8e092c Mon Sep 17 00:00:00 2001 From: Fabian Joswig Date: Thu, 21 Oct 2021 11:53:50 +0100 Subject: [PATCH] fits fit_exp removed --- .github/workflows/flake8.yml | 2 +- CHANGELOG.md | 1 + pyerrors/fits.py | 28 ---------------------------- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml index 0766352d..e75a5ae1 100644 --- a/.github/workflows/flake8.yml +++ b/.github/workflows/flake8.yml @@ -1,4 +1,4 @@ -name: flake8 Lint +name: flake8 on: push: diff --git a/CHANGELOG.md b/CHANGELOG.md index 259f61ef..92681a4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file. - The function `plot_corrs` was deprecated as all its functionality is now contained within `Corr.show` - The kwarg `bias_correction` in `derived_observable` was removed - Obs no longer have an attribute `e_Q` +- Removed `fits.fit_exp` ## [1.1.0] - 2021-10-11 ### Added diff --git a/pyerrors/fits.py b/pyerrors/fits.py index 1781df37..d57445bd 100644 --- a/pyerrors/fits.py +++ b/pyerrors/fits.py @@ -512,34 +512,6 @@ def fit_lin(x, y, **kwargs): raise Exception('Unsupported types for x') -def fit_exp(data, **kwargs): - """Fit a single exponential to a discrete time series of Obs without errors. - - Keyword arguments - ----------------- - shift -- specifies the absolute timeslice value of the first entry of data (default 0.0) - only important if one is interested in the matrix element, for the mass this is irrelevant. - """ - if 'shift' in kwargs: - shift = kwargs.get("shift") - else: - shift = 0 - length = len(data) - xsum = 0 - xsum2 = 0 - ysum = 0 - xysum = 0 - for i in range(shift, length + shift): - xsum += i - xsum2 += i ** 2 - tmp_log = np.log(np.abs(data[i - shift])) - ysum += tmp_log - xysum += i * tmp_log - res0 = -(length * xysum - xsum * ysum) / (length * xsum2 - xsum * xsum) # mass - res1 = np.exp((xsum2 * ysum - xsum * xysum) / (length * xsum2 - xsum * xsum)) # matrix element - return [res0, res1] - - def qqplot(x, o_y, func, p): """ Generates a quantile-quantile plot of the fit result which can be used to check if the residuals of the fit are gaussian distributed.