qlat_utils.rjackknife¶
- qlat_utils.rjackknife(data_list, jk_idx_list, *, avg=None, rng_state=None, n_rand_sample=None, jk_blocking_func=None, is_normalizing_rand_sample=False, is_apply_rand_sample_jk_idx_blocking_shift=True, is_use_old_rand_alg=False, eps=1, is_sync_node=False)[source]¶
Jackknife-bootstrap hybrid resampling. Return
jk_arr.len(jk_arr) == 1 + n_rand_sampledistribution ofjk_arrshould be similar as the distribution ofavg.r_{i,j} ~ N(0, 1)n ::n- if is_normalizing_rand_sample:
n_j = sum_i r_{i,j}^2 r_{i,j} <- sqrt{n_rand_sample / n_j} r_{i,j}
data_list_real = [d for d in data_list if d is not None] data_arr = np.array(data_list_real, dtype=dtype) avg = average(data_arr) len(data_list_real) = n jk_arr[0] = avg jk_arr[i] = avg + sum_{j=1}^{n} (-eps/sqrt{n (n - b(i,j))}) r_{i,j} (data_list_real[j] - avg)n
where
b(i,j)represent theblock_size.n ifjk_blocking_funcis provided::njk_blocking_func(i, jk_idx) => blocked jk_idxn- ::n
jk_arr[i] = avg + sum_{j=1}^{n} r_{i,jk_block_func(j)} (jk_arr[j] - avg)n
- If
is_sync_nodeis True:n Assume this is a collective operation in a MPI program where every node have the same input. The operation is performed by
rjackknife_sync_node, which splits the input between the nodes and callsrjackknife_distributed; every node obtains the completejk_arr, which agrees with the one obtained withis_sync_node=Falseup to the floating-point roundoff (not bit-for-bit, because the average and the sums over the data set are reduced across the nodes).qlat(used forq.get_comm()) andmpi4pyare imported only whenis_sync_nodeis True.