def CalcDelta(nCR,delta_tot,delta_normX,CR):
# Calculate total normalized Euclidean distance for each crossover value
# Derive sum_p2 for each different CR value
for zz in range(0,nCR):
# Find which chains are updated with zz/MCMCPar.nCR
idx = np.argwhere(CR==(1.0+zz)/nCR);idx=idx[:,0]
# Add the normalized squared distance tot the current delta_tot;
delta_tot[0,zz] = delta_tot[0,zz] + np.sum(delta_normX[idx])
return delta_tot
评论列表
文章目录