I’m relatively new to PyMC, so I might be making a very simple error. A little bit about the problem I’m trying to model. There is food that is potentially contaminated which is being tested. We know the false positive and false negative rates of the testing procedure. I’m trying to get some bounds on the actual number of contaminated samples.

```
n = 100
y = 50
fn = .2
fp = .1
with Model() as food_model:
positives = pm.DiscreteUniform("positives", lower = 0, upper = n)
true_positives = pm.Binomial("true_positives", n = positives, p = (1 - fn))
false_positives = pm.Binomial("false_positives", n = y - positives, p = fp)
model = pm.Deterministic('model', true_positives + false_positives, observed = y)
with food_model:
# Draw samples
trace = sample(1000, njobs=2)
# Plot parameter
forestplot(trace, varnames=['positives'])
```

The error is:

TypeError Traceback (most recent call last)

in ()

7 true_positives = pm.Binomial(“true_positives”, n = positives, p = (1 - fn))

8 false_positives = pm.Binomial(“false_positives”, n = y - positives, p = fp)

----> 9 model = pm.Deterministic(‘model’, true_positives + false_positives, observed = y)

10

11

TypeError: Deterministic() got an unexpected keyword argument ‘observed’

For reference, I used the advice given here: https://github.com/pymc-devs/pymc3/issues/1108