tedana.metrics.external.fit_mixing_to_regressors

fit_mixing_to_regressors(component_table: DataFrame, external_regressors: DataFrame, external_regressor_config: Dict, mixing: ndarray[tuple[int, ...], dtype[_ScalarType_co]], detrend_regressors: DataFrame) DataFrame[source]

Compute Linear Model and calculate F statistics and P values for combinations of regressors.

Equation: Y = XB + E - Y = each ICA component (mixing) - X = Design (Regressor) matrix (subsets of noise_regress_table) - B = Weighting Factors (solving for B) - E = errors (Y - Y_pred OR Y - XB)

Parameters:
  • component_table ((C x X) pandas.DataFrame) – Component metric table. One row for each component, with a column for each metric. The index is the component number.

  • external_regressors (pandas.DataFrame) – Each column is a labelled regressor and the number of rows should match the number of timepoints in the fMRI time series

  • external_regressor_config (dict) – Information describing the external regressors and method to use for fitting and statistical tests. In other functions this is a list[dict] but here it is a single dict which is one element in the list[dict]

  • mixing ((T x C) array_like) – Mixing matrix for converting input data to component space, where C is components and T is the same as in data_cat

  • detrend_regressors ((n_vols x polort) pandas.DataFrame) – Dataframe containing the detrending regressor time series

Returns:

component_table ((C x X) pandas.DataFrame) – Component metric table. Same as inputted, with added columns for metrics related to external regressor fits. New columns for F, R2, and p values for the full model and all partial models. Names are “Fstat Full Model”, “pval Full Model”, “R2stat Full Model”, and “Full” is replaced by the partial model name for each partial model