Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RF: Simplify high-pass filtering in algorithms.confounds #3651

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Commits on May 30, 2024

  1. RF: Simplify high-pass filtering in algorithms.confounds

    Legendre and cosine detrending are implemented almost identically,
    although with several minor variations. Here I separate regressor
    creation from detrending to unify the implementations.
    
    This now uses `np.linalg.pinv(X)` to estimate the betas in both cases,
    rather than using `np.linalg.lstsq` in the cosine filter. lstsq uses SVD
    and can thus fail to converge in rare cases. Under no circumstances
    should (X.T @ X) be singular, so the pseudoinverse is unique and
    precisely what we want.
    effigies committed May 30, 2024
    Configuration menu
    Copy the full SHA
    f4a2390 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4717e23 View commit details
    Browse the repository at this point in the history
  3. FIX: Normalize constant column to 0th

    For Legendre regressors, the ith column is the ith-order polynomial, so
    the constant column is 0. For the cosine regressors, a constant column
    was appended to the end, in contradiction of the docstring. This brings
    both into alignment so columns are sorted from lowest to highest
    frequency and aligns the DCT behavior with its docstring.
    effigies committed May 30, 2024
    Configuration menu
    Copy the full SHA
    5107714 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    17bac08 View commit details
    Browse the repository at this point in the history