cardioception.PAT.scoring.mean_resultant_length#

cardioception.PAT.scoring.mean_resultant_length(theta, weights=None)[source]#

Mean resultant length of a set of angles.

R = |sum_r w_r exp(i theta_r)| / sum_r w_r, with all weights 1 when weights is None.

Parameters
thetaarray-like

Angles in radians.

weightsarray-like or None

Non-negative weights, one per angle (confidence ratings, for example).

Returns
Rfloat

Between 0 and 1. Angles or weights that are NaN are ignored. NaN when no angle is left or the weights sum to 0.