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 asdpnp.ndarray
. Dimension of input arraym
is limited bym.ndim > 2
. Size and shape of input arrays are supported to be equal. Prametersy
is supported only with default valueNone
. Prametersrowvar
is supported only with default valueTrue
. Prametersbias
is supported only with default valueFalse
. Prametersddof
is supported only with default valueNone
. Prametersfweights
is supported only with default valueNone
. Prametersaweights
is supported only with default valueNone
. 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]