A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
cov
ArrayFire Functions | ArrayFire Functions by Category » Statistics » Basic statistics functions

## Functions
AFAPI array | cov (const array &X, const array &Y, const bool isbiased=false)
| C++ Interface for covariance.
AFAPI array | cov (const array &X, const array &Y, const af_var_bias bias)
| C++ Interface for covariance.
AFAPI af_err | af_cov (af_array *out, const af_array X, const af_array Y, const bool isbiased)
| C Interface for covariance.
AFAPI af_err | af_cov_v2 (af_array *out, const af_array X, const af_array Y, const af_var_bias bias)
| C Interface for covariance.

## Detailed Description

Find the covariance of values in the input

This function performs the operation across all dimensions of the input array.

## Function Documentation

## ◆ af_cov()

AFAPI af_err af_cov | ( | af_array * | out,
|  | const af_array | X,
|  | const af_array | Y,
|  | const bool | isbiased )

C Interface for covariance.

Parameters

  [out] | out | will the covariance of the input arrays
  [in] | X | is the first input array
  [in] | Y | is the second input array
  [in] | isbiased | is boolean specifying if biased estimate should be taken (default: false)

Returns
  AF_SUCCESS if the operation is successful, otherwise an appropriate error code is returned.

Deprecated
  Use af_cov_v2 instead

## ◆ af_cov_v2()

AFAPI af_err af_cov_v2 | ( | af_array * | out,
|  | const af_array | X,
|  | const af_array | Y,
|  | const af_var_bias | bias )

C Interface for covariance.

Parameters

  [out] | out | will the covariance of the input arrays
  [in] | X | is the first input array
  [in] | Y | is the second input array
  [in] | bias | The type of bias used for variance calculation. Takes of value of type af_var_bias

Returns
  AF_SUCCESS if the operation is successful, otherwise an appropriate error code is returned.

## ◆ cov() [1/2]

AFAPI array cov | ( | const array & | X,
|  | const array & | Y,
|  | const af_var_bias | bias )

C++ Interface for covariance.

Parameters

  [in] | X | is the first input array
  [in] | Y | is the second input array
  [in] | bias | The type of bias used for variance calculation. Takes of value of type af_var_bias.

Returns
  the covariance of the input arrays

## ◆ cov() [2/2]

AFAPI array cov | ( | const array & | X,
|  | const array & | Y,
|  | const bool | isbiased = false )

C++ Interface for covariance.

Parameters

  [in] | X | is the first input array
  [in] | Y | is the second input array
  [in] | isbiased | is boolean specifying if biased estimate should be taken (default: false)

Returns
  the covariance of the input arrays

Deprecated
  Use af::cov(const array&, const array& const af_var_bias)