numpy.corrcoef

numpy.corrcoef(x, y=None, rowvar=1, bias=0, ddof=None)

Return correlation coefficients.

Please refer to the documentation for cov for more detail. The relationship between the correlation coefficient matrix, P, and the covariance matrix, C, is

System Message: WARNING/2 (P_{ij} = \frac{ C_{ij} } { \sqrt{ C_{ii} * C_{jj} } } )

latex exited with error: [stderr] [stdout] This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/TeX Live for SUSE Linux) restricted \write18 enabled. entering extended mode (./math.tex LaTeX2e <2011/06/27> Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, ge rman-x-2011-07-01, ngerman-x-2011-07-01, afrikaans, ancientgreek, ibycus, arabi c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian, kurmanji, lao, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal, nyn orsk, polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbia nc, slovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorb ian, welsh, loaded. (/usr/share/texmf/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/share/texmf/tex/latex/base/size12.clo)) (/usr/share/texmf/tex/latex/base/inputenc.sty ! LaTeX Error: File `utf8x.def’ not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: def) Enter file name: ! Emergency stop. <read *> l.131 \endinput ^^M No pages of output. Transcript written on math.log.

The values of P are between -1 and 1, inclusive.

Parameters :

x : array_like

A 1-D or 2-D array containing multiple variables and observations. Each row of m represents a variable, and each column a single observation of all those variables. Also see rowvar below.

y : array_like, optional

An additional set of variables and observations. y has the same shape as m.

rowvar : int, optional

If rowvar is non-zero (default), then each row represents a variable, with observations in the columns. Otherwise, the relationship is transposed: each column represents a variable, while the rows contain observations.

bias : int, optional

Default normalization is by (N - 1), where N is the number of observations (unbiased estimate). If bias is 1, then normalization is by N. These values can be overridden by using the keyword ddof in numpy versions >= 1.5.

ddof : {None, int}, optional

New in version 1.5.

If not None normalization is by (N - ddof), where N is the number of observations; this overrides the value implied by bias. The default value is None.

Returns :

out : ndarray

The correlation coefficient matrix of the variables.

See also

cov
Covariance matrix

Previous topic

numpy.var

Next topic

numpy.correlate

This Page