Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. """
  2. PYMC3 model code to do signature fitting using NUTS
  3. """
  4. import pymc3
  5. from theano import tensor
  6.  
  7. mytest = pymc3.Model()
  8. counts = data
  9. with mytest:
  10. mixing_proportions = pymc3.Dirichlet('mixing_proportions', a = np.ones(30), shape = 30)
  11. likelihood = pymc3.Multinomial('likelihood',
  12. n = counts.sum(),
  13. p = tensor.dot(signatures.T, mixing_proportions),
  14. observed = counts)
  15.  
  16. with mytest:
  17. trace = pymc3.sample(10000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement