N = len(pdf)
pdf_mask = np.ones((N,),dtype="int16")
if M == None:
M = np.round(0.10 * len(pdf))
jk_pdf = np.empty((M,))
for ii in range(0, M):
rand_index = np.round(np.random.random() * (N - 1))
//choose a unique random sample to remove
while pdf_mask[rand_index] == 0 :
rand_index = np.round(np.random.random() * (N - 1))
//set mask to zero for chosen random index
pdf_mask[rand_index] = 0
jk_pdf[ii] = statistic(pdf[pdf_mask > 0])
return jk_pdf, np.mean(jk_pdf) - statistic(pdf), M/(M-1)*np.std(jk_pdf)
def residual_bootstrap(data):
pass
After Change
mask_index = np.copy(pdf_mask)
if M == None:
M = N
M = np.minimum(M, N - 1)
jk_pdf = np.empty((M,))
for ii in range(0, M):
rand_index = np.round(np.random.random() * (N - 1))