def t2_test(): mc = 100 ts = np.zeros(mc) for i in range(mc): data = make_data(0,1) ts[i] = t2_value(data) histo(ts)
def hotelling_T2_test(): ''' This is not working! There is no rhyme or reason in the p value - ''' mc = 100 p = np.zeros(mc) for i in range(mc): data = make_data(0,1) p[i] = hotelling_T2(data) histo(p)
def analyze_lots_of_trials(): '''' plots a histogram of T2 values for many iterations ''' sigma_known = 0.2 mu_known = 0 #faux data mc = 100 ts = np.zeros(mc) for i in range(mc): data = make_data(mu_known, sigma_known) ts[i] = return_T2_value(data) from visualization import histo histo(ts,'r', 'lots of trials')
def analyze_varying_sigma(): ''' plots a histogram of T2 values for many iterations of varying sigma ''' mc = 100 sigma = np.linspace(eps, 1, mc) mu_known = 0 ts = np.zeros(mc) #change keep track of T2 over varying sigma for i, s in zip(range(mc), sigma): data = make_data(mu_known, s) ts[i] = return_T2_value(data) from visualization import histo histo(ts,'r', 'varying sigma') plt.plot(ts)