Skip to content

Commit

Permalink
Improve computation of D4x repeatability at the session level
Browse files Browse the repository at this point in the history
  • Loading branch information
mdaeron committed Dec 9, 2023
1 parent e03d97b commit 1e4dab0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions D47crunch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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*

Expand Down

0 comments on commit 1e4dab0

Please sign in to comment.