Commits

dan mackinlay committed f4a1f08

primitive plot

Comments (0)

Files changed (2)

 * Parallelise in something natural, such as redis or 0MQ, or ruffus.
 * store data in sqlite for ease of processing
 * store intermediate trials in sqlite too
-* calibrate pyentropy to work out why i get large positive information between deterministic variables.
+* calibrate pyentropy to work out why i get nonzero information between independent variables
 * refactor into topic-based modules
 """
     'n_branches': 100,
 }
 
+def plot_of_swept_experiment(iterable):
+    import matplotlib.pyplot as plt
+    from collections import defaultdict
+    from scipy.stats.mstats import mquantiles
+    valz = defaultdict(list)
+    for param, val in iterable:
+        valz[param['noise']].extend(list(val))
+    x = np.array(sorted(valz.keys()))
+    y_arrays = [np.array(valz[x_val]) for x_val in x]
+    y_medians = np.array([mquantiles(y_array, prob=[0.5])[0] for y_array in y_arrays])
+    y_low = np.array([mquantiles(y_array, prob=[0.25])[0] for y_array in y_arrays])
+    y_high = np.array([mquantiles(y_array, prob=[0.75])[0] for y_array in y_arrays])
+    y_err = np.vstack([y_medians-y_low, y_high-y_medians])
+    plt.errorbar(x, y_medians, yerr=y_err)
+    return x, y_arrays
+
 def stashed_swept_experiment(db_url = OUTPUT_DB_URL, *args, **kwargs):
     import persistence
     session = persistence.get_db_session(OUTPUT_DB_URL)