Created
February 10, 2018 04:12
-
-
Save WillKoehrsen/d25c08af178df6c5c5c786fa9fb7a604 to your computer and use it in GitHub Desktop.
This file contains 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
with pm.Model() as duration_model: | |
# Three parameters to sample | |
alpha_skew = pm.Normal('alpha_skew', mu=0, tau=0.5, testval=3.0) | |
mu_ = pm.Normal('mu', mu=0, tau=0.5, testval=7.4) | |
tau_ = pm.Normal('tau', mu=0, tau=0.5, testval=1.0) | |
# Duration is a deterministic variable | |
duration_ = pm.SkewNormal('duration', alpha = alpha_skew, mu = mu_, | |
sd = 1/tau_, observed = duration) | |
# Metropolis Hastings for sampling | |
step = pm.Metropolis() | |
duration_trace = pm.sample(N_SAMPLES, step=step) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment