neuroprob/utils/stats.py
def corr_lin_circ_Kempter(x, theta, a):
    """
    Circular-linear correlation coefficient as defined by the following papers:

    :param numpy.array x: input array x of shape (samples,)
    :param numpy.array theta: input array theta of shape (samples,)
    :param float a: slope divided by 2pi

    References:

    [1] Kempter et al. (2012) Note: phi and theta are reversed
    [2] Jammalamadaka and Sengupta (2001)
    """
    theta_bar = np.arctan2(np.sum(np.sin(theta)),np.sum(np.cos(theta)))
    phi = 2*np.pi*a*x % (2*np.pi)
    phi_bar = np.arctan2(np.sum(np.sin(phi)), np.sum(np.cos(phi)))
    num = np.sum(np.sin(theta - theta_bar) * np.sin(phi - phi_bar))
    den = np.sqrt(np.sum(np.sin(theta - theta_bar)**2) * np.sum(np.sin(phi - phi_bar)**2))

    return num / den

    Circular-linear correlation coefficient as defined by the following papers:

    :param numpy.array x: input array x of shape (samples,)
    :param numpy.array theta: input array theta of shape (samples,)
    :param float a: slope divided by 2pi

    References:

    [1] Kempter et al. (2012) Note: phi and theta are reversed
    [2] Jammalamadaka and Sengupta (2001)
    
Circular-linear correlation coefficient as defined by the following papers.
Circular - linear correlation coefficient as defined by the following papers .
def corr_lin_circ_Kempter(x, theta, a):
    theta_bar = np.arctan2(np.sum(np.sin(theta)),np.sum(np.cos(theta)))
    phi = 2*np.pi*a*x % (2*np.pi)
    phi_bar = np.arctan2(np.sum(np.sin(phi)), np.sum(np.cos(phi)))
    num = np.sum(np.sin(theta - theta_bar) * np.sin(phi - phi_bar))
    den = np.sqrt(np.sum(np.sin(theta - theta_bar)**2) * np.sum(np.sin(phi - phi_bar)**2))
    return num / den
def corr_lin_circ_Kempter ( x , theta , a ) : theta_bar = np . arctan2 ( np . sum ( np . sin ( theta ) ) , np . sum ( np . cos ( theta ) ) ) phi = 2 * np . pi * a * x % ( 2 * np . pi ) phi_bar = np . arctan2 ( np . sum ( np . sin ( phi ) ) , np . sum ( np . cos ( phi ) ) ) num = np . sum ( np . sin ( theta - theta_bar ) * np . sin ( phi - phi_bar ) ) den = np . sqrt ( np . sum ( np . sin ( theta - theta_bar ) ** 2 ) * np . sum ( np . sin ( phi - phi_bar ) ** 2 ) ) return num / den
Circular-linear correlation coefficient as defined by the following papers:
Circular - linear correlation coefficient as defined by the following papers :
"""
    Circular-linear correlation coefficient as defined by the following papers:

    :param numpy.array x: input array x of shape (samples,)
    :param numpy.array theta: input array theta of shape (samples,)
    :param float a: slope divided by 2pi

    References:

    [1] Kempter et al. (2012) Note: phi and theta are reversed
    [2] Jammalamadaka and Sengupta (2001)
    """
x
input array x of shape (samples,)
input array x of shape ( samples )
theta
input array theta of shape (samples,)
input array theta of shape ( samples )
a
slope divided by 2pi
References.

[1] Kempter et al. (2012) Note: phi and theta are reversed
[2] Jammalamadaka and Sengupta (2001)
slope divided by 2pi References . [ 1 ] Kempter et al . ( 2012 ) Note : phi and theta are reversed [ 2 ] Jammalamadaka and Sengupta ( 2001 )