statsmodels.multivariate.cancorr.CanCorr#

class statsmodels.multivariate.cancorr.CanCorr(endog, exog, tolerance=1e-08, missing='none', hasconst=None, **kwargs)[source]#

Canonical correlation analysis using singular value decomposition

For matrices exog=x and endog=y, find projections x_cancoef and y_cancoef such that:

x1 = x * x_cancoef, x1’ * x1 is identity matrix y1 = y * y_cancoef, y1’ * y1 is identity matrix

and the correlation between x1 and y1 is maximized.

Parameters:
endogarray_like

The endogenous (left-hand-side) variables.

exogarray_like

The exogenous (right-hand-side) variables.

tolerancefloat

Eigenvalue tolerance, values smaller than which are considered 0.

missingstr

Available options are ‘none’, ‘drop’, and ‘raise’. If ‘none’, no nan checking is done. If ‘drop’, any observations with nans are dropped. If ‘raise’, an error is raised. Default is ‘none’.

hasconstNone or bool

Indicates whether the RHS includes a user-supplied constant. If True, a constant is assumed. If False, no constant is checked for. If None, the code checks for a constant.

**kwargs

Extra arguments that are used to set model properties when using the formula interface.

Attributes:
endogndarray

See Parameters.

exogndarray

See Parameters.

cancorrndarray

The canonical correlation values

y_cancoefndarray

The canonical coefficients for endog

x_cancoefndarray

The canonical coefficients for exog

Methods

corr_test()

Approximate F test

fit()

Fit a model to data

from_formula(formula, data[, subset, drop_cols])

Create a Model from a formula and dataframe

predict(params[, exog])

After a model has been fit, predict returns the fitted values

References

Methods

corr_test()

Approximate F test

fit()

Fit a model to data

from_formula(formula, data[, subset, drop_cols])

Create a Model from a formula and dataframe

predict(params[, exog])

After a model has been fit, predict returns the fitted values

Properties

endog_names

Names of endogenous variables

exog_names

Names of exogenous variables