dpnp.cov
- dpnp.cov(m, y=None, rowvar=True, bias=False, ddof=None, fweights=None, aweights=None, *, dtype=None)[source]
Estimate a covariance matrix, given data and weights.
For full documentation refer to
numpy.cov
.- Returns:
out -- The covariance matrix of the variables.
- Return type:
dpnp.ndarray
Limitations
Input array
m
is supported asdpnp.ndarray
. Dimension of input arraym
is limited bym.ndim <= 2
. Size and shape of input arrays are supported to be equal. Parameter y is supported only with default valueNone
. Parameter bias is supported only with default valueFalse
. Parameter ddof is supported only with default valueNone
. Parameter fweights is supported only with default valueNone
. Parameter aweights is supported only with default valueNone
. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Available array 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]