You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create figure 2 models in pyro. use render_model to export to dot so that it can be read into pygraphviz.
importpyrodeffigure_2a_confounder():
""" Simulates the confounder model for Figure 2(a) in the paper. """# Define the confounder modeldefconfounder_model():
# Define the prior distribution for the confounder variableconfounder=pyro.sample("U", dist.Uniform(0.0, 1.0))
# Define the prior distribution for the treatment variablewithpyro.plate("students", 10):
treatment=pyro.sample("A", dist.Bernoulli(confounder))
# Define the prior distribution for the outcome variableoutcome=pyro.sample("Y", dist.Normal(confounder+2.0*treatment, 1.0))
returnoutcomereturnconfounder_modelpyro.render_model(figure_2a_confounder(), render_deterministic=True, filename="confounder.dot")
create figure 2 models in pyro. use render_model to export to
dot
so that it can be read intopygraphviz
.confounder.dot.txt
The text was updated successfully, but these errors were encountered: