dirconn.TRGC#
- class dirconn.TRGC(order: int | str = 'bic', max_order: int = 10, conditional: bool = True, ridge: float = 0.0, demean: bool = True, n_folds: int = 5, check_order_stability: bool = True, check_whiteness: bool = True)#
Time-reversed Granger causality, difference-based (Haufe et al. 2013; Winkler et al. 2016).
values[i, j] = (F_ij - F_ji) - (R_ij - R_ji), whereFisGCon the data andRisGCon the data reversed in time. A lagged influence ofionjmakes the first bracket positive and, because the reversal turns it around, the second negative, so both add up; an instantaneous mixture makes both brackets alike, so it cancels. The result is antisymmetric (values[j, i] = -values[i, j]), in nats, with an undefined (NaN) diagonal; a positive value means net predictive flow fromitoj. This is predictive influence, not interventional causality.The order is chosen once, on the data, and reused for the reversed data. The two net flows are recorded in the provenance (
net_forwardandnet_reversed, NaN asnull), and so are the two Granger matrices.- Parameters:
order – As for
GC;conditionaldecides whether both Granger fits condition on all other channels. The order-stability and whiteness checks run on the forward fit only.max_order – As for
GC;conditionaldecides whether both Granger fits condition on all other channels. The order-stability and whiteness checks run on the forward fit only.conditional – As for
GC;conditionaldecides whether both Granger fits condition on all other channels. The order-stability and whiteness checks run on the forward fit only.ridge – As for
GC;conditionaldecides whether both Granger fits condition on all other channels. The order-stability and whiteness checks run on the forward fit only.demean – As for
GC;conditionaldecides whether both Granger fits condition on all other channels. The order-stability and whiteness checks run on the forward fit only.n_folds – As for
GC;conditionaldecides whether both Granger fits condition on all other channels. The order-stability and whiteness checks run on the forward fit only.check_order_stability – As for
GC;conditionaldecides whether both Granger fits condition on all other channels. The order-stability and whiteness checks run on the forward fit only.check_whiteness – As for
GC;conditionaldecides whether both Granger fits condition on all other channels. The order-stability and whiteness checks run on the forward fit only.
- __init__(order: int | str = 'bic', max_order: int = 10, conditional: bool = True, ridge: float = 0.0, demean: bool = True, n_folds: int = 5, check_order_stability: bool = True, check_whiteness: bool = True) None#
Methods
__init__([order, max_order, conditional, ...])fit(data)Estimate directed connectivity.
get_params()Return the constructor parameters as a dictionary.
Attributes
check_order_stabilitycheck_whitenessconditionaldemeaninfomax_ordern_foldsorderridge