pingouin.circ_corrcl

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

Correlation coefficient between one circular and one linear variable random variables.

Parameters
xnp.array

First circular variable (expressed in radians)

ynp.array

Second circular variable (linear)

tailstring

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

Returns
rfloat

Correlation coefficient

pvalfloat

Uncorrected p-value

Notes

Python code borrowed from brainpipe (based on the MATLAB toolbox CircStats)

Please note that NaN are automatically removed from datasets.

Examples

Compute the r and p-value between one circular and one linear variables.

>>> from pingouin import circ_corrcl
>>> x = [0.785, 1.570, 3.141, 0.839, 5.934]
>>> y = [1.593, 1.291, -0.248, -2.892, 0.102]
>>> r, pval = circ_corrcl(x, y)
>>> print(r, pval)
0.109 0.9708899750629237