#NEWLINE# def von_mises_cdf( k , x ) : #NEWLINE# #INDENT# ix = ( ( 2 * np . pi ) * np . round ( ( x / ( 2 * np . pi ) ) ) ) #NEWLINE# x = ( x - ix ) #NEWLINE# k = float ( k ) #NEWLINE# CK = 50 #NEWLINE# a = [ 28.0 , 0.5 , 100.0 , 5.0 ] #NEWLINE# if ( k < CK ) : #NEWLINE# #INDENT# p = int ( np . ceil ( ( ( a [ 0 ] + ( a [ 1 ] * k ) ) - ( a [ 2 ] / ( k + a [ 3 ] ) ) ) ) ) #NEWLINE# F = np . clip ( von_mises_cdf_series ( k , x , p ) , 0 , 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# F = von_mises_cdf_normalapprox ( k , x ) #NEWLINE# #UNINDENT# return ( F + ix )