3.11.15.1.1. statsmodels.stats.multivariate_tools.cancorr

statsmodels.stats.multivariate_tools.cancorr(x1, x2, demean=True, standardize=False)[source]

canonical correlation coefficient beween 2 arrays

Parameters:

x1, x2 : ndarrays, 2_D

two 2-dimensional data arrays, observations in rows, variables in columns

demean : bool

If demean is true, then the mean is subtracted from each variable

standardize : bool

If standardize is true, then each variable is demeaned and divided by its standard deviation. Rescaling does not change the canonical correlation coefficients.

Returns:

ccorr : ndarray, 1d

canonical correlation coefficients, sorted from largest to smallest. Note, that these are the square root of the eigenvalues.

See also

cc_ranktest, cc_stats, CCA

Notes

This is a helper function for other statistical functions. It only calculates the canonical correlation coefficients and does not do a full canoncial correlation analysis

The canonical correlation coefficient is calculated with the generalized matrix inverse and does not raise an exception if one of the data arrays have less than full column rank.