Skip to content
Science templates

Bayesian workflow — prior predictive to posterior checks

Organise a Bayesian analysis around a generative model, prior predictive checks, computation diagnostics and posterior predictive comparison. Sensitivity to prior and likelihood choices is part of the result.

Template previewScience
Rendering…

What this template contains

Source
26 lines

Make it your own.

{
  "nodes": [
    { "id": "q", "type": "rounded", "label": "Question and estimand", "x": 40, "y": 200, "width": 150, "height": 104, "fill": "#ede9fe", "stroke": "#6d28d9" },
    { "id": "gen", "type": "rounded", "label": "Likelihood and data model", "x": 215, "y": 200, "width": 150, "height": 104, "fill": "#fef3c7", "stroke": "#b45309" },
    { "id": "prior", "type": "octagon", "label": "Prior assumptions", "x": 215, "y": 520, "width": 150, "height": 104, "fill": "#e0f2fe", "stroke": "#0369a1" },
    { "id": "pred", "type": "card", "label": "Prior predictive check", "x": 390, "y": 520, "width": 150, "height": 104, "fill": "#ccfbf1", "stroke": "#0f766e" },
    { "id": "obs", "type": "rounded", "label": "Observed data", "x": 390, "y": 40, "width": 150, "height": 104, "fill": "#ede9fe", "stroke": "#6d28d9" },
    { "id": "post", "type": "rounded", "label": "Posterior computation", "x": 565, "y": 200, "width": 150, "height": 104, "fill": "#fef3c7", "stroke": "#b45309" },
    { "id": "diag", "type": "octagon", "label": "Computation diagnostics", "x": 740, "y": 40, "width": 150, "height": 104, "fill": "#e0f2fe", "stroke": "#0369a1" },
    { "id": "ppc", "type": "octagon", "label": "Posterior predictive check", "x": 740, "y": 360, "width": 150, "height": 104, "fill": "#e0f2fe", "stroke": "#0369a1" },
    { "id": "sens", "type": "rounded", "label": "Sensitivity and interpretation", "x": 915, "y": 200, "width": 150, "height": 104, "fill": "#fce7f3", "stroke": "#be185d" }
  ],
  "edges": [
    { "id": "e0", "source": "q", "target": "gen", "label": "formalise" },
    { "id": "e1", "source": "gen", "target": "pred", "label": "simulate" },
    { "id": "e2", "source": "prior", "target": "pred", "label": "simulate" },
    { "id": "e3", "source": "pred", "target": "prior", "label": "revise implausible assumptions", "style": "dashed" },
    { "id": "e4", "source": "gen", "target": "post", "label": "condition" },
    { "id": "e5", "source": "prior", "target": "post", "label": "condition" },
    { "id": "e6", "source": "obs", "target": "post", "label": "evidence" },
    { "id": "e7", "source": "post", "target": "diag", "label": "convergence" },
    { "id": "e8", "source": "post", "target": "ppc", "label": "model adequacy" },
    { "id": "e9", "source": "diag", "target": "sens", "label": "trust computation" },
    { "id": "e10", "source": "ppc", "target": "sens", "label": "trust scope" }
  ]
}