Last active
January 23, 2017 18:47
-
-
Save kgori/5ad0fa2859811122c344088de81f9b0d to your computer and use it in GitHub Desktop.
PYMC3 model code to do signature fitting using NUTS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment