pingouin.circ_corrcc

pingouin.circ_corrcc(x, y, tail='two-sided')[source]

Correlation coefficient between two circular variables.

Parameters
xnp.array

First circular variable (expressed in radians)

ynp.array

Second circular variable (expressed in radians)

tailstring

Specify whether to return ‘one-sided’ or ‘two-sided’ p-value.

Returns
rfloat

Correlation coefficient

pvalfloat

Uncorrected p-value

Notes

Adapted from the CircStats MATLAB toolbox (Berens 2009).

Use the np.deg2rad function to convert angles from degrees to radians.

Please note that NaN are automatically removed.

Examples

Compute the r and p-value of two circular variables

>>> from pingouin import circ_corrcc
>>> x = [0.785, 1.570, 3.141, 3.839, 5.934]
>>> y = [0.593, 1.291, 2.879, 3.892, 6.108]
>>> r, pval = circ_corrcc(x, y)
>>> print(r, pval)
0.942 0.06579836070349088