import numpy as np
from filters import bayes
from plots import plot_bayes
belief = [0, 0, 0.4, 0.6, 0, 0, 0, 0, 0, 0]
prior = bayes.prior_with_jitter(belief, 2, 0.8, 0.1, 0.1)
plot_bayes.plot_belief_prior(belief, prior, ylim=(0, 0.6))
belief = [0.05, 0.05, 0.05, 0.05, 0.55, 0.05, 0.05, 0.05, 0.05, 0.05]
prior = bayes.prior_by_convol(belief, offset=1, kernel=[0.1, 0.8, 0.1])
plot_bayes.plot_belief_prior(belief, prior, ylim=(0, 0.6))
data = np.array([1, 1, 0, 0, 0, 0, 0, 0, 1, 0])
prior = np.array([0.1] * 10)
likelihood = bayes.likelihood(data, z=1, z_prob=0.75)
posterior = bayes.posterior(likelihood, prior)
plot_bayes.plot_prior_posterior(prior, posterior, ylim=(0, 0.6))
kernel = (0.1, 0.8, 0.1)
prior = bayes.prior_by_convol(posterior, 1, kernel)
likelihood = bayes.likelihood(data, z=1, z_prob=0.75)
posterior = bayes.posterior(likelihood, prior)
plot_bayes.plot_prior_posterior(prior, posterior, ylim=(0, 0.6))
prior = bayes.prior_by_convol(posterior, 1, kernel)
likelihood = bayes.likelihood(data, z=0, z_prob=0.75)
posterior = bayes.posterior(likelihood, prior)
plot_bayes.plot_prior_posterior(prior, posterior, ylim=(0, 0.6))
prior = bayes.prior_by_convol(posterior, 1, kernel)
likelihood = bayes.likelihood(data, z=0, z_prob=0.75)
posterior = bayes.posterior(likelihood, prior)
plot_bayes.plot_prior_posterior(prior, posterior, ylim=(0, 0.6))