- Main Page
- Tutorials
- Functions
- Release Notes
- Examples

Functions
corrcoef
Complete List of ArrayFire Functions ArrayFire Functions by Category » Statistics » | Basic statistics functions

Find the correlation coefficient of values in the input. More...

## Functions
template<typename T >
AFAPI T | corrcoef (const array &X, const array &Y)
| C++ Interface for correlation coefficient. More...
AFAPI af_err | af_corrcoef (double *realVal, double *imagVal, const af_array X, const af_array Y)
| C Interface for correlation coefficient. More...

## Detailed Description

Find the correlation coefficient of values in the input.

This function performs the operation across all batches present in the input simultaneously.

## Function Documentation

AFAPI af_err af_corrcoef | ( | double * | realVal,
|  | double * | imagVal,
|  | const af_array | X,
|  | const af_array | Y
| ) |  |

C Interface for correlation coefficient.

Parameters

  [out] | realVal | will contain the real part of correlation coefficient of the inputs
  [out] | imagVal | will contain the imaginary part of correlation coefficient of the inputs
  [in] | X | is the first input array
  [in] | Y | is the second input array

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

Note
  There are many ways correlation coefficient is calculated. This algorithm returns Pearson product-moment correlation coefficient.

AFAPI T af::corrcoef | ( | const array & | X,
|  | const array & | Y
| ) |  |

C++ Interface for correlation coefficient.

Parameters

  [in] | X | is the first input array
  [in] | Y | is the second input array

Returns
  correlation coefficient of the input arrays

Note
  There are many ways correlation coefficient is calculated. This algorithm returns Pearson product-moment correlation coefficient.