Calculate component-wise kappa/rho degrees of freedom based on weight maps
Summary
Ever since #358, we've been calculating our voxel-wise model fit F-statistics on varying numbers of echoes. When we average across voxels, we're averaging F-statistics with different DOFs. Then, we use the full n_echos for calculating a single DOF for all components' averaged F-statistics.
However, the actual degrees of freedom should vary across components. While the voxel-wise degrees of freedom will be consistent across components, the weights we use to average across voxels vary across components, which means that the ultimate average DOF will vary as well.
I very much doubt that this has a large impact on the the classification, but it seems like it would be beneficial to deal with for internal consistency.
Additional Detail
This stems from https://github.com/ME-ICA/tedana/pull/809#discussion_r715100247.
Next Steps
- Add a new metric that calculates the weighted average degrees of freedom of kappa and rho values based on each component's weight map and the adaptive mask.
- Use the new metric in
getfboundsfor .scipy.stats.f.ppfsupports float values for thedfdparameter.