neuroprob/utils/stats.py
def KS_sampling_dist(x, samples, K=100000):
    """
    Sampling distribution for the Brownian bridge supremum (KS test sampling distribution).
    """
    k = np.arange(1,K+1)[None, :]
    return 8*x * ((-1)**(k-1) * k**2 * np.exp(-2*k**2 * x[:, None]**2 * samples)).sum(-1) * samples

    Sampling distribution for the Brownian bridge supremum (KS test sampling distribution).
    
Sampling distribution for the Brownian bridge supremum (KS test sampling distribution).
Sampling distribution for the Brownian bridge supremum ( KS test sampling distribution ) .
def KS_sampling_dist(x, samples, K=100000):
    k = np.arange(1,K+1)[None, :]
    return 8*x * ((-1)**(k-1) * k**2 * np.exp(-2*k**2 * x[:, None]**2 * samples)).sum(-1) * samples
def KS_sampling_dist ( x , samples , K = 100000 ) : k = np . arange ( 1 , K + 1 ) [ None , : ] return 8 * x * ( ( - 1 ) ** ( k - 1 ) * k ** 2 * np . exp ( - 2 * k ** 2 * x [ : , None ] ** 2 * samples ) ) . sum ( - 1 ) * samples
Sampling distribution for the Brownian bridge supremum (KS test sampling distribution).
Sampling distribution for the Brownian bridge supremum ( KS test sampling distribution ) .
"""
    Sampling distribution for the Brownian bridge supremum (KS test sampling distribution).
    """
x
samples
K