def kuiper(data, dtype=np.float64):
 data = np.sort(data, axis=0).astype(dtype)
 shape = data.shape
 n_dim = len(shape)
 n_trials = shape[0]
 j1 = ((np.arange(n_trials, dtype=dtype) + 1.0) / float(n_trials))
 j2 = (np.arange(n_trials, dtype=dtype) / float(n_trials))
 if (n_dim > 1):
  j1 = j1[:, np.newaxis]
  j2 = j2[:, np.newaxis]
 d1 = (j1 - data).max(axis=0)
 d2 = (data - j2).max(axis=0)
 n_eff = n_trials
 d = (d1 + d2)
 return (d, _prob_kuiper(d, n_eff, dtype=dtype))

def kuiper ( data , dtype = np . float64 ) : data = np . sort ( data , axis = 0 ) . astype ( dtype ) shape = data . shape n_dim = len ( shape ) n_trials = shape [ 0 ] j1 = ( ( np . arange ( n_trials , dtype = dtype ) + 1.0 ) / float ( n_trials ) ) j2 = ( np . arange ( n_trials , dtype = dtype ) / float ( n_trials ) ) if ( n_dim > 1 ) : j1 = j1 [ : , np . newaxis ] j2 = j2 [ : , np . newaxis ] d1 = ( j1 - data ) . max ( axis = 0 ) d2 = ( data - j2 ) . max ( axis = 0 ) n_eff = n_trials d = ( d1 + d2 ) return ( d , _prob_kuiper ( d , n_eff , dtype = dtype ) )
kuipers test of uniform distribution .