@@ -0,0 +1,1684 @@
+%22%22%22%0AAnimated demo showing optimization of a bandit with independent arms.%0A%22%22%22%0A%0Afrom __future__ import division%0Afrom __future__ import absolute_import%0Afrom __future__ import print_function%0A%0Aimport numpy as np%0A%0Afrom reggie import BetaBernoulli%0Afrom ezplot import figure, show%0A%0A%0Adef main():%0A    %22%22%22Run the demo.%22%22%22%0A    # define the model and sample an instance from it%0A    n = 10%0A    rng = np.random.RandomState(3)%0A    model = BetaBernoulli(np.ones(n))%0A    f = model.sample(rng=rng)%0A%0A    # grab the optimal latent value and make lists of observations%0A    xopt = f.argmax()%0A    fopt = f.max()%0A%0A    # create a new figure%0A    fig = figure(figsize=(10, 6))%0A%0A    while True:%0A        # evaluate the posterior before updating the model for plotting%0A        mu = model.get_quantile(0.5)%0A        lo = model.get_quantile(0.05)%0A        hi = model.get_quantile(0.95)%0A%0A        # get our index%0A        target = mu.max()%0A        index = model.get_improvement(target)%0A%0A        # query%0A        x = index.argmax()%0A        y = int(rng.uniform() %3C f%5Bx%5D)%0A%0A        # add the data%0A        model.add_data(x, y)%0A%0A        # PLOT EVERYTHING%0A        fig.clear()%0A        ax1 = fig.add_subplotspec((2, 1), (0, 0), hidex=True)%0A        ax2 = fig.add_subplotspec((2, 1), (1, 0), hidey=True, sharex=ax1)%0A%0A        ax1.errorbar(np.arange(n), mu, (mu-lo, hi-mu), ls='', marker='s',%0A                     markersize=20, capsize=30, capthick=2)%0A        ax1.axvline(xopt, zorder=-1)%0A        ax1.axhline(fopt, zorder=-1)%0A        ax1.set_ylim(0, 1)%0A        ax1.set_xlim(-0.3, n-1+0.3)%0A%0A        ax2.bar(np.arange(n)-0.25, index, 0.5)%0A%0A        # draw%0A        fig.canvas.draw()%0A        show()%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add a bandit demo.