statistics

pycorr.statistics.isc_corrmat_within_diff(indxA, indxB, C)[source]

Faster within-group subject-total correlation contrast using correlation matrix

Parameters:
  • indxA (list) – list of indices corresponding to group A members.
  • indxB (list) – likewise for group B (should be no overlap)
Returns:

ndarray with isc for A minus isc for B.

pycorr.statistics.isc_within_diff(A, B, standardized=False)[source]

Contrast within-group subject-total correlation for A and B.

This function operates on the timecourse data, so is slower than isc_corrmat_within_diff. Inputs may be multi-dimensional. The last dimension is used for correlations (e.g. time should be last).

Parameters:
  • A (list) – List of timecourse data for each member of group A.
  • B (list) – Timecourses of same length as A.
Returns:

ndarray with isc for A minus isc for B.

pycorr.statistics.perm(A, B, fun, nreps=1, out=None, **kwargs)[source]

Permutation test. Randomly shuffles group labels, then runs fun. Group sizes are preserved.

Parameters:
  • A – lists with elements (or indices) to permute across groups
  • B – similar to A, but other group
  • fun – function of form fun(new_A, new_B, [opt1, ... ,])
  • nreps – number of repetitions
  • out – optional container for results (e.g. numpy array with dtype)
  • kwargs – optional parameters passed to fun