def all_equil_tests(sink,str_beta,corr=True): rows,cols=2,2 fig,ax=plt.subplots(rows,cols,figsize=(10,10),sharey=True,sharex=True) plt.subplots_adjust(hspace=0.1,wspace=0) for row in range(rows): for col in range(cols): if row == 0 and col == 0: time_LHS,welch,ks,U= steady_state_test_rw_to_end(sink,corr=corr) elif row == 0 and col == 1: time_LHS,welch,ks,U= steady_state_test_rw_to_rw(sink,dt=0.1,wind_dt=0.2,corr=corr) elif row == 1 and col == 0: time_LHS,welch,ks,U= steady_state_test_rw_to_rw(sink,dt=0.5,wind_dt=0.2,corr=corr) elif row == 1 and col == 1: time_LHS,welch,ks,U= steady_state_test_rw_to_rw(sink,dt=1.,wind_dt=0.2,corr=corr) else: raise ValueError ax[row,col].plot(time_LHS,welch['p'],c='r',lw=2,label="Welch's t") ax[row,col].plot(time_LHS,ks['p'],c='b',lw=2,label='KS') ax[row,col].plot(time_LHS,U['p'],c='y',lw=2,label='U') if row == 0 and col == 0: ax[row,col].set_title('row to end') elif row == 0 and col == 1: ax[row,col].set_title('dt=0.1,wind_dt= 0.2') elif row == 1 and col == 0: ax[row,col].set_title('dt=0.5,wind_dt=0.2') elif row == 1 and col == 1: ax[row,col].set_title('dt=1.0,wind_dt=0.2') ax[row,col].set_ylim(-0.1,1.1) #samples are sequential time ranges ax[1,1].legend(loc=0,fontsize='small') for col in range(2): ax[1,col].set_xlabel(r'$\mathbf{ t_{LHS}/t_{\rm{BH}} }$',fontweight='bold',fontsize='xx-large') for row in range(2): ax[row,0].set_ylabel("P(t)",fontweight='bold',fontsize='xx-large') plt.savefig(os.path.join(os.path.dirname(args.master_sink),'all-equil-test-%s.png' % args.str_beta)) plt.close()
def when_equil_begins(ax,sink,str_beta,corr=True): #samples are sequential time ranges time_LHS,welch,ks,U= steady_state_test_rw_to_end(sink,corr=corr) #ax.plot(time_LHS,welch['p'],c='r',lw=2,label="Welch's t test") #ax.plot(time_LHS,ks['p'],c='b',lw=2,label='KS 2 sample') ax.plot(time_LHS,U['p'],c='y',lw=2,label='U test') ax.plot(ax.get_xlim(),[0.05]*2,'k--',label='P=0.05') ax.legend(loc=0,fontsize='small') ax.set_xlabel(r'$\mathbf{ t_{LHS}/t_{\rm{BH}} }$',fontweight='bold',fontsize='xx-large') ax.set_ylabel("P(t)",fontweight='bold',fontsize='xx-large') ax.set_ylim(-0.1,1.1) #return time when reach equilibrium return time_LHS[ U['p'] >= 0.05 ][0]