cca_zoo
                                
                                 cca_zoo copied to clipboard
                                
                                    cca_zoo copied to clipboard
                            
                            
                            
                        Do you have a CCA method incorporated with Multivariate Granger causality?
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
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
Might be able to adapt this to your case!
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 :)
Thanks for your reply! Not yet working on coding the causality by myself. But you pointed good directions for a check later.