Skip to content

Instantly share code, notes, and snippets.

@tiagofer
Last active February 4, 2021 03:10
Show Gist options
  • Save tiagofer/c02c1273850b55f011b3766fb7aa0572 to your computer and use it in GitHub Desktop.
Save tiagofer/c02c1273850b55f011b3766fb7aa0572 to your computer and use it in GitHub Desktop.
with pm.Model() as model_30:
#priori
p_30 = pm.Uniform('p_30',lower=0, upper=1)
#likelihood
obs_30 = pm.Bernoulli('obs_30', p_30, observed=g30_1)
#MCMC
step = pm.Metropolis()
trace = pm.sample(2000, step = step)
#remove os primeiros 1000 parâmetros que tendem a ser mais ruidosos
burned_trace_30 = trace[1000:]
with pm.Model() as model_40:
p_40 = pm.Uniform('p_40',lower=0, upper=1)
obs_40 = pm.Bernoulli('obs_40', p_40, observed=g40_1)
step = pm.Metropolis()
trace = pm.sample(2000, step = step)
burned_trace_40 = trace[1000:]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment