From 1e4dab09fe8e43e3f1a3200ccf43c4c735bbb09d Mon Sep 17 00:00:00 2001 From: mdaeron Date: Sat, 9 Dec 2023 12:31:07 +0100 Subject: [PATCH] Improve computation of D4x repeatability at the session level --- D47crunch/__init__.py | 4 ++++ changelog.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/D47crunch/__init__.py b/D47crunch/__init__.py index b631459..30fa9a4 100755 --- a/D47crunch/__init__.py +++ b/D47crunch/__init__.py @@ -2217,6 +2217,10 @@ def consolidate_sessions(self): if self.standardization_method == 'pooled': for session in self.sessions: + # different (better?) computation of D4x repeatability for each session: + sqresiduals = [(r[f'D{self._4x}'] - self.samples[r['Sample']][f'D{self._4x}'])**2 for r in self.sessions[session]['data']] + self.sessions[session][f'r_D{self._4x}'] = np.mean(sqresiduals)**.5 + self.sessions[session]['a'] = self.standardization.params.valuesdict()[f'a_{pf(session)}'] i = self.standardization.var_names.index(f'a_{pf(session)}') self.sessions[session]['SE_a'] = self.standardization.covar[i,i]**.5 diff --git a/changelog.md b/changelog.md index 4352baa..d4f9893 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog +### Bugfix +* Simpler (better?) computation of D4x repeatability at the session level when using pooled regression method. + + ## v2.4.0 *Released on 2023-10-04*