def _merge_DC_to_base(self, X_DC, X_base, no_DC):
        """ Merge DC components X_DC to the baseline time series
            X_base (By baseline, this means any fixed nuisance
            regressors not updated during fitting, including DC
            components and any nuisance regressors provided by
            the user.
            X_DC is always in the first few columns of X_base.
        """
        if X_base is not None:
            reg_sol = np.linalg.lstsq(X_DC, X_base)
            if not no_DC:
                if not np.any(np.isclose(reg_sol[1], 0)):
                    # No columns in X_base can be explained by the
                    # baseline regressors. So we insert them.
                    X_base = np.concatenate((X_DC, X_base), axis=1)
                    idx_DC = np.arange(0, X_DC.shape[1])
                else:
                    logger.warning('Provided regressors for uninteresting '
                                   'time series already include baseline. '
                                   'No additional baseline is inserted.')
                    idx_DC = np.where(np.isclose(reg_sol[1], 0))[0]
            else:
                idx_DC = np.where(np.isclose(reg_sol[1], 0))[0]
        else:
            # If a set of regressors for non-interested signals is not
            # provided, then we simply include one baseline for each run.
            X_base = X_DC
            idx_DC = np.arange(0, X_base.shape[1])
            logger.info('You did not provide time series of no interest '
                        'such as DC component. Trivial regressors of'
                        ' DC component are included for further modeling.'
                        ' The final covariance matrix won''t '
                        'reflect these components.')
        return X_DC, X_base, idx_DC
def _merge_DC_to_base ( self , X_DC , X_base , no_DC ) : if X_base is not None : reg_sol = np . linalg . lstsq ( X_DC , X_base ) if not no_DC : if not np . any ( np . isclose ( reg_sol [ 1 ] , 0 ) ) : X_base = np . concatenate ( ( X_DC , X_base ) , axis = 1 ) idx_DC = np . arange ( 0 , X_DC . shape [ 1 ] ) else : logger . warning ( 'Provided regressors for uninteresting ' 'time series already include baseline. ' 'No additional baseline is inserted.' ) idx_DC = np . where ( np . isclose ( reg_sol [ 1 ] , 0 ) ) [ 0 ] else : idx_DC = np . where ( np . isclose ( reg_sol [ 1 ] , 0 ) ) [ 0 ] else : X_base = X_DC idx_DC = np . arange ( 0 , X_base . shape [ 1 ] ) logger . info ( 'You did not provide time series of no interest ' 'such as DC component. Trivial regressors of' ' DC component are included for further modeling.' ' The final covariance matrix won' 't ' 'reflect these components.' ) return X_DC , X_base , idx_DC
Merge DC components X_DC to the baseline time series
            X_base (By baseline, this means any fixed nuisance
            regressors not updated during fitting, including DC
            components and any nuisance regressors provided by
            the user.
            X_DC is always in the first few columns of X_base.