Refer to unstandardized PEs as PEs and standardized PEs as betas - #1338
Refer to unstandardized PEs as PEs and standardized PEs as betas#1338tsalo wants to merge 15 commits into
Conversation
Rename what we've been calling "betas", but which are actually *unstandardized* parameter estimates, to "pes" (variable name) or "parameter estimates" (metric name).
Rename what we've been calling "weights" (actually standardized parameter estimates, or betas) and "z-statistics" (also actually betas) to "betas" (variables) or "standardized parameter estimates" (metrics).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1338 +/- ##
==========================================
- Coverage 90.21% 90.20% -0.02%
==========================================
Files 30 30
Lines 4867 4861 -6
Branches 820 820
==========================================
- Hits 4391 4385 -6
Misses 316 316
Partials 160 160 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR standardizes terminology around parameter estimates: unstandardized estimates are now referred to as PEs, and standardized estimates as betas/standardized parameter estimates, across code, metrics, tests, and documentation. It also removes the obsolete calculate_z_maps path in favor of directly using standardized parameter estimates and updates configuration/metadata and deprecation handling for old metric names.
Changes:
- Renamed functions, variables, metrics, and tests to distinguish unstandardized parameter estimates (PEs) from standardized parameter estimates (betas), including
calculate_weights→calculate_standardized_parameter_estimatesandcalculate_betas→calculate_unstandardized_parameter_estimates. - Updated dependence metrics and collections to use
beta_maps(standardized parameter estimates) instead ofz_maps/“weights” and adjustedmetrics.jsonplus the dependency resolver to deprecate old metric labels (e.g.,"map weight","map optcom betas") in favor of new names. - Cleaned up reporting and documentation (static figures, outputs, denoising, dependence metrics, and approach docs) so user-facing descriptions match the new PE/beta nomenclature, while removing the now-unused
calculate_z_mapsfunction and its tests.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tedana/workflows/tedana.py |
Renames comments and internal regression coefficients from “betas” to PEs in the main workflow and orthogonalization step, aligning terminology without changing behavior. |
tedana/workflows/ica_reclassify.py |
Mirrors the orthogonalization coefficient rename from “betas” to PEs during reclassification, maintaining consistent math. |
tedana/tests/test_stats.py |
Updates get_coeffs and fit_model tests to expect PEs instead of betas while preserving numerical checks and shapes. |
tedana/tests/test_metrics_dependence.py |
Removes tests for the deleted calculate_z_maps and rewrites dependence metrics tests to use beta_maps and PE terminology. |
tedana/tests/test_metrics.py |
Adds/updates smoke tests for the new calculate_standardized_parameter_estimates and calculate_unstandardized_parameter_estimates, and switches all dependence tests from z_maps to beta_maps and from betas to PEs where appropriate. |
tedana/stats.py |
Changes get_coeffs and fit_model docstrings/locals from betas to PEs without altering the underlying least-squares computation; tests confirm behavior. |
tedana/resources/config/metrics.json |
Renames metric keys and dependencies (e.g., "map weight" → "map optcom standardized parameter estimates", "map optcom betas" → "map optcom parameter estimates", "map beta T2 clusterized" → "map PE T2 clusterized"), keeping the dependency graph consistent with the new naming. |
tedana/reporting/static_figures.py |
Adjusts comments and docstrings to refer to PEs instead of betas for component maps and recomputed images used in static reports. |
tedana/metrics/external.py |
Renames fit coefficients from betas to PEs in fit_model_with_stats and fit_mixing_to_regressors, updating docstrings while leaving F/R² computation unchanged. |
tedana/metrics/dependence.py |
Introduces calculate_standardized_parameter_estimates/calculate_unstandardized_parameter_estimates, removes calculate_z_maps, rewrites F-map and dependence calculations to operate on PEs/betas, and switches signal-vs-noise helpers to beta_maps/beta_clmaps. |
tedana/metrics/collect.py |
Changes default and required metric names, uses the new dependence functions, rewires kappa/rho, variance explained, Dice, signal-noise, PSC, and clusterized maps to the renamed metrics, and updates metadata text for PE-based maps. |
tedana/metrics/_utils.py |
Extends deprecated_metrics to reject legacy metric labels (e.g., "map weight", "map optcom betas") with guidance to the new names, and refreshes determine_signs docstrings to speak in terms of parameter estimates. |
tedana/io.py |
Renames internal regression coefficients to PEs in denoising and mixing-reconstruction routines, and clarifies naming for z-scored component maps while preserving I/O behavior. |
tedana/gscontrol.py |
Renames regression coefficients from betas to PEs in global signal regression while keeping the same linear algebra and variance-explained computation. |
tedana/decay.py |
Renames log-linear regression coefficients from betas to PEs in T2*/S0 estimation, with unchanged numerical logic. |
docs/outputs.rst |
Updates the description of the component spatial map from “beta map” to “PE map” and its text to talk about parameter estimates (with a small spelling issue noted). |
docs/dependence_metrics.rst |
Clarifies that TEDPCA/TEDICA uses raw PEs (not standardized betas) in the dependence models, matching the new code path. |
docs/denoising.rst |
Adjusts example code snippets to use pes and “parameter estimates” instead of betas, aligning denoising recipes with the code changes. |
docs/approach.rst |
Revises description of how parameter estimates are used for reconstruction and TE-(in)dependence modeling to use the PE terminology, including the explanation figure caption. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Some things will only make sense once #1337 is merged, so I'll hold off on requesting reviews until that's done. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
tedana/metrics/external.py:405
- This commented-out TODO block references
pes_full, but the return value fromfit_model_with_statsis currently discarded (_ = ...). Either capture the returned parameter estimates if you intend to save them, or remove/update this TODO so it doesn't reference an undefined variable. Also, fix the typo inexte rnal_regressorsinside the comment to avoid confusion if this code is ever re-enabled.
# TODO pes_full_model are the fits to all external regressors and might be useful to save
# TODO Also consider saving regressor_models or the detrending regressors
# pes_full_model = pd.DataFrame(
# data=pes_full.T,
# columns=np.concatenate(
# (np.array(detrend_regressors.columns), np.array(exte rnal_regressors.columns))
# ),
# )
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Closes #1309.
Changes proposed in this pull request:
calculate_z_mapsfunction.As a result, a number of metrics have been renamed: