using Stochy, Gadfly, Stochy.GadflySupport
posterior = @pp pmcmc(100,100) do
local
colors = [:black, :blue, :green, :orange, :red],
prototype = 5 * ~Dir(5, 1.0),
bag1 = ~Dir(prototype),
bag2 = ~Dir(prototype),
bag3 = ~Dir(prototype),
bagn = ~Dir(prototype)
observe(Discrete(colors, bag1), :blue, :blue, :black, :blue, :blue, :blue)
observe(Discrete(colors, bag2), :blue, :green, :blue, :blue, :blue, :red)
observe(Discrete(colors, bag3), :blue, :blue, :blue, :blue, :blue, :orange)
# Posterior predictive.
~Discrete(colors, bagn)
end;
bar(posterior)