我计算了250次测量的平均值、上限和下限。我有三个250个元素的数组。现在我想生成置信区间,我用一种简单的方法来实现
fig = plt.figure(figsize=(8,8))
fig.subplots_adjust(wspace=1.,hspace=1.)
indx = np.argsort(hat_y[:,0])
ysmoothed = gaussian_filter1d(hat_y[indx,0], sigma=2)
plt.plot(ysmoothed, label="average")
uppersmooth = gaussian_filter1d(hat_y[indx,0]+1.96*np.sqrt(var_y[indx,0]*1.0/np.sqrt(B)),2)
plt.plot(uppersmooth, linestyle='-', linewidth=1, label="upper bound")
lowersmooth = gaussian_filter1d(hat_y[indx,0]-1.96*np.sqrt(var_y[indx,0]*1.0/np.sqrt(B)),2)
plt.plot(lowersmooth, linestyle='-', linewidth=1, label="lower bound")
是否有一种方法可以将三个数组(平均、上限、下限)作为输入参数,并在python中生成点图,以显示每个测量的不确定性
目前没有回答
相关问题 更多 >
编程相关推荐