I have just started learning pymc3 so I might be thinking about this completely the wrong way.
Assume that we observe a vector of 10 booleans.
The process of interest generates (observed) booleans with a Bernoulli distribution with a parameter theta1. So I define a Beta prior over theta1 and define a variable with length 10 that is a sample from Bernoulli(theta1).
However, this true sample is disturbed by sometimes switching the true data to 0, with a probability theta2. So I define a switch to 0 with a probability Bernoulli(theta2).
The switched values are the observed ones. I am not sure how to tell the model that I observed the switched variables, i.e. I am not sure how to fit the model to the observed data.
This is what I have for now, and I am kind of stuck:
# observed data (already switched)
observed_data = np.random.binomial(1, 0.5, size=10)
with pm.Model() as skeptic_model:
# uniform probability of the bernoulli parameter
true_model_prior = pm.Beta("true_model_prior", 1, 1)
true_data = pm.Bernoulli("true_data", p=true_model_prior, shape=data.shape)
disturbed_data = pm.math.switch(pm.Bernoulli("disturbed", 0.1), true_data, 0)