# statsmodels.multivariate.cancorr.CanCorr¶

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

Canonical correlation analysis using singluar 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.

endog

See Parameters.

Type

array

exog

See Parameters.

Type

array

cancorr

The canonical correlation values

Type

array

y_cancoeff

The canonical coeefficients for endog

Type

array

x_cancoeff

The canonical coefficients for exog

Type

array

References

*

http://numerical.recipes/whp/notes/CanonCorrBySVD.pdf

http://www.csun.edu/~ata20315/psy524/docs/Psy524%20Lecture%208%20CC.pdf

http://www.mathematica-journal.com/2014/06/canonical-correlation-analysis/

Methods

 Approximate F test Perform multivariate statistical tests of the hypothesis that there is no canonical correlation between endog and exog. 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.

Attributes

 endog_names Names of endogenous variables exog_names Names of exogenous variables
{"ft_lang_label":"__label__en","ft_lang_prob":0.5913435,"math_prob":0.78542817,"size":1355,"snap":"2019-13-2019-22","text_gpt3_token_len":388,"char_repetition_ratio":0.12583272,"word_repetition_ratio":0.033707865,"special_character_ratio":0.24132842,"punctuation_ratio":0.15,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9903205,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-05-21T08:35:15Z\",\"WARC-Record-ID\":\"<urn:uuid:20cbb7d1-4fe7-4a13-852a-d01d394dbf8a>\",\"Content-Length\":\"13306\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:21f46ee3-a1bd-4323-bccb-e1790accffd0>\",\"WARC-Concurrent-To\":\"<urn:uuid:9b897631-220e-4851-a09f-e56bd295cc7a>\",\"WARC-IP-Address\":\"185.199.108.153\",\"WARC-Target-URI\":\"http://www.statsmodels.org/dev/generated/statsmodels.multivariate.cancorr.CanCorr.html\",\"WARC-Payload-Digest\":\"sha1:EBI6UBQS22H7LSBH4A6VXCYCP64RXXQB\",\"WARC-Block-Digest\":\"sha1:LBJNODO7FMNDE3E2HXZ5PQBU3EBBL4VE\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-22/CC-MAIN-2019-22_segments_1558232256314.25_warc_CC-MAIN-20190521082340-20190521104340-00255.warc.gz\"}"}