htfa.dynamic_connectivity

htfa.dynamic_connectivity(weights, window)[source]

Sliding-window Pearson correlation between factor time courses.

Parameters:
weightsndarray, shape (K, T)

Factor weights over samples.

windowint

Window length in samples (2 <= window <= T).

Returns:
ndarray, shape (T - window + 1, K, K)

Examples

>>> import numpy as np
>>> w = np.random.default_rng(0).standard_normal((3, 50))
>>> dynamic_connectivity(w, 20).shape
(31, 3, 3)