diff --git a/infocalc.py b/infocalc.py index 0be12e1..c0668c0 100755 --- a/infocalc.py +++ b/infocalc.py @@ -113,9 +113,10 @@ if args.lowerbound is not None: prob_lower = t.cdf(df=df,x=args.lowerbound, loc=mean, scale=stddev) prob = prob_upper - prob_lower -#print("probability: %f", prob) info = -np.emath.log2(prob) -#print("information content: %f bits", info) +logger.info(f"n={samplesize},df={df},mean={mean},stddev={stddev}") +logger.info(f"P()={prob},I={info} bits") + ## set default fontsize matplotlib.rcParams['font.size']=args.fontsize ## place text on plot: https://matplotlib.org/3.3.4/gallery/recipes/placing_text_boxes.html @@ -149,9 +150,7 @@ if args.lowerbound is not None: if args.upperbound is not None: plt.axvline(args.upperbound, color="red") -plt.plot(x, y, 'b-', label='Normal distribution') -#yt = scipy.stats.t.pdf(x, len(data)-1, mean, stddev) -#plt.plot(x, yt, 'g-', label='T Distribution') +plt.plot(x, y, 'b-', label='T distribution') # Filter for which region to fill coloredregion = x#default fill all