0
$\begingroup$

I am trying to code a function which computes Moore's modified version of the Rayleigh test. I am doing ok with the second half of the calculation but I am unsure how to "number the vectors according to rank/vector length".

Currently my phases would be something like [0, 0, 0, 60, 60, 90, 180, 180, 270] (for example) and the radii would be [30, 40, 50, 60, 70, 80, 90, 100, 110].

def MR_test(phases, radius):  
    
    sorted_radius = sort(radius)
    
    x = sum(weights*cos(sorted_radius))
    y = sum(weights*sin(sorted_radius))
    
    r2 = ((x**2)*(y**2))
    r = sqrt(r2)
    r_val = r/(n**(1.5))
    
    r_phase = atan2(y, x)
    return r_val, r_phase 

How do I code the first part of the Moore-Rayleigh test? Thank you!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.