Using pymc to solve the simple cancer problem (Example of the cancer problem that I'm thinking of: http://www.yudkowsky.net/rational/bayes).
I'm attempting to understand how to apply pymc in different circumstances.   I was trying to solve the above problem but it seems like there are two issues:


*

*All the parameters are known already.  All of the probabilities are fixed before hand.

*There is no data coming in to infer upon.


Am I thinking about this correctly?  Or is there a way to use pymc on this problem?
 A: I found something close (http://healthyalgorithms.com/2011/11/23/causal-modeling-in-python-bayesian-networks-in-pymc/) and came up with the following:
#### simple_cancer.py
import pylab as pl
import pymc as mc

# 1% of women at age forty who participate in routine screening have
# breast cancer.  80% of women with breast cancer will get positive
# mammographies.  9.6% of women without breast cancer will also get
# positive mammographies.  A woman in this age group had a positive
# mammography in a routine screening.  What is the probability that
# she actually has breast cancer?

POS_obs = [1.]
N = len(POS_obs)

C = mc.Bernoulli('C', .01)

@mc.deterministic
def p_POS(C=C):
    if C:
        return .8
    else:
        return .096

POS = mc.Bernoulli('POS', p_POS, value=POS_obs, observed=True)

### run_simple_cancer.py
import pymc as mc
import simple_cancer
m = mc.MCMC(simple_cancer)
m.sample(100000)

c = m.trace('C')[:]
print sum(c), 1.0*sum(c)/len(c)

This gives me the answer I expected and seems to match the problem structure in the way I expected.   I'd appreciate feedback if I've done something wrong and/or there is a better way to go about it.
