(This article was originally published at Doing Bayesian Data Analysis, and syndicated at StatsBlogs.)
To make the contrast concrete, let's consider the classic "rats" example from BUGS. I will start with a textual explanation of the model (using modified phrasing and variable names), and then provide two diagrams of the model, one in DAG style and one in DBDA style. Here is the text:
The data come from 30 young rats whose weights were measured weekly starting at birth for five weeks, with the goal being to assess how their weights changed as a function of age. The variable yj|i denotes the weight of the ith rat measured at days since birth xj|i. The weights are assumed to be distributed normally around the predicted value ωj|i (omega):Below are two different diagrams of the model. The first is a DAG. Because there are a variety of style conventions in the literature for DAGs, I used my own hybrid explained in the caption. But I think it is a good and useful hybrid, one that I would want to use if I used DAGs. Take a look at the DAG:yj|i ~ normal( ωj|i , λ ) The parameter λ (lambda) represents the precision (i.e., 1/variance) of the normal distribution. The predicted weight of the ith rat is modeled as a linear function of days since birth:ωj|i = φi + ξi xj|i The individual intercepts φi (phi) and slopes ξi (xi) are assumed to come from group-level normal distributions,φi ~ normal( κ , δ ) and ξi ~ normal( ζ , γ ) where κ (kappa) and ζ (zeta) are the means of the group-level distributions. The priors on the group-level means are set as vague normal distributions,κ ~ normal( M , H ) and ζ ~ normal( M , H ) where the mean M is approximately central on the scale of the data and the precision H is very small. The precision parameters, λ (lambda), δ (delta), and γ (gamma), are given vague gamma priors,λ ~ gamma( K , I ) and δ ~ gamma( K , I ) and γ ~ gamma( K , I ) where the shape K and rate I parameters are set to very small values.
Below is a DBDA-style diagram for the model:
![]() |
| Arrows marked by "~" denote stochastic dependency, arrows marked by "=" denote deterministic dependency. Ellipses on arrows denote indices over which the dependency applies. |
Please provide your answers as comments on this post. Thank you in advance!
Please comment on the article here: Doing Bayesian Data Analysis


