You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't implement this paper and have no particular knowledge of causal methods but I am vaguely aware that there is a connection between CCA and Granger Causality. From a quick scan you can substitute in MCCA or CCA for matlab canoncorr. The residualization steps you'd need to do yourself.
By an odd coincidence I have just written a residualization function for someone else in an unrelated project:
def residualize(X, C):
"""
A simple function that residualizes the input features X by
subtracting the contributions from the confound variables C
"""
# Check and convert the input arrays
X = check_array(X)
C = check_array(C, ensure_2d=False)
if C.ndim == 1:
C = C[:, np.newaxis]
# Clone and fit the regression model
regr_model = LinearRegression()
regr_model.fit(C, X)
# Predict and subtract the contributions of confounds
X_predicted = regr_model.predict(C)
X_residualized = X - X_predicted
return X_residualized
If you end up implementing the multivariate grainger causality using any of the cca-zoo code give me a shout and I'll put a link to it on the readme page :)
Hey James,
Do you have a MCCA method incorporated with Multivariate Granger causality, similar as applied in this paper? https://ieeexplore.ieee.org/document/5959956
Cheers,
Wantong
The text was updated successfully, but these errors were encountered: