Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.ma.cov

numpy.ma.cov(x,y=None,rowvar=True,bias=False,allow_masked=True,ddof=None)[source]

Estimate the covariance matrix.

Except for the handling of missing data this function does the same asnumpy.cov. For more details and examples, seenumpy.cov.

By default, masked values are recognized as such. Ifx andy have thesame shape, a common mask is allocated: ifx[i,j] is masked, theny[i,j] will also be masked.Settingallow_masked to False will raise an exception if values aremissing in either of the input arrays.

Parameters:
x:array_like

A 1-D or 2-D array containing multiple variables and observations.Each row ofx represents a variable, and each column a singleobservation of all those variables. Also seerowvar below.

y:array_like, optional

An additional set of variables and observations.y has the sameform asx.

rowvar:bool, optional

Ifrowvar is True (default), then each row represents avariable, with observations in the columns. Otherwise, the relationshipis transposed: each column represents a variable, while the rowscontain observations.

bias:bool, optional

Default normalization (False) is by(N-1), whereN is thenumber of observations given (unbiased estimate). Ifbias is True,then normalization is byN. This keyword can be overridden bythe keywordddof in numpy versions >= 1.5.

allow_masked:bool, optional

If True, masked values are propagated pair-wise: if a value is maskedinx, the corresponding value is masked iny.If False, raises aValueError exception when some values are missing.

ddof:{None, int}, optional

If notNone normalization is by(N-ddof), whereN isthe number of observations; this overrides the value implied bybias. The default value isNone.

New in version 1.5.

Raises:
ValueError

Raised if some values are missing andallow_masked is False.

See also

numpy.cov

Previous topic

numpy.ma.corrcoef

Next topic

numpy.ma.cumsum

Quick search

  • © Copyright 2008-2018, The SciPy community.
  • Last updated on Jul 24, 2018.
  • Created usingSphinx 1.6.6.

[8]ページ先頭

©2009-2025 Movatter.jp