timecorr.isfc

Contents

timecorr.isfc#

timecorr.isfc(data, timepoint_weights)[source]#

Compute Inter-Subject Functional Connectivity (ISFC).

ISFC computes correlations between each subject’s data and the average of all other subjects, providing a measure of shared neural patterns across participants while avoiding self-correlation artifacts.

Parameters:
datalist of numpy.ndarray or numpy.ndarray

List of timeseries data matrices, each of shape (timepoints, features). If a single array is provided, it will be converted to a list.

timepoint_weightsnumpy.ndarray

T x T matrix of temporal weights for dynamic correlations

Returns:
list of numpy.ndarray

List of correlation matrices (one per subject), each showing correlations between that subject and the average of all others

Examples

>>> import timecorr as tc
>>> import numpy as np
>>> data = [np.random.randn(100, 10) for _ in range(5)]  # 5 subjects
>>> weights = tc.gaussian_weights(100, {'var': 10})
>>> isfc_results = tc.isfc(data, weights)
>>> len(isfc_results)  # 5