dpnp.cov

dpnp.cov(x1, y=None, rowvar=True, bias=False, ddof=None, fweights=None, aweights=None)[source]

Estimate a covariance matrix, given data and weights.

For full documentation refer to numpy.cov.

Limitations

Input array m is supported as dpnp.ndarray. Dimension of input array m is limited by m.ndim > 2. Size and shape of input arrays are supported to be equal. Prameters y is supported only with default value None. Prameters rowvar is supported only with default value True. Prameters bias is supported only with default value False. Prameters ddof is supported only with default value None. Prameters fweights is supported only with default value None. Prameters aweights is supported only with default value None. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.

See also

dpnp.corrcoef normalized covariance matrix.

Examples

>>> import dpnp as np
>>> x = np.array([[0, 2], [1, 1], [2, 0]]).T
>>> x.shape
(2, 3)
>>> [i for i in x]
[0, 1, 2, 2, 1, 0]
>>> out = np.cov(x)
>>> out.shape
(2, 2)
>>> [i for i in out]
[1.0, -1.0, -1.0, 1.0]