Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- PYMC3 model code to do signature fitting using NUTS
- """
- import pymc3
- from theano import tensor
- mytest = pymc3.Model()
- counts = data
- with mytest:
- mixing_proportions = pymc3.Dirichlet('mixing_proportions', a = np.ones(30), shape = 30)
- likelihood = pymc3.Multinomial('likelihood',
- n = counts.sum(),
- p = tensor.dot(signatures.T, mixing_proportions),
- observed = counts)
- with mytest:
- trace = pymc3.sample(10000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement