|
1442 | 1442 | "source": [
|
1443 | 1443 | "## Model 3: Partial pooling model\n",
|
1444 | 1444 | "\n",
|
1445 |
| - "Model 3 assumes the same causal DAG as model 2 (see above). However, we can go further and incorporate more knowledge about the structure of our data. Rather than treating each group as entirely independent, we can use our knowledge that these groups are drawn from a population-level distribution. We could formalise this as saying that the group-level slopes and intercepts are modeled as deflections from a population-level slopes and intercepts, respectively." |
| 1445 | + "Model 3 assumes the same causal DAG as model 2 (see above). However, we can go further and incorporate more knowledge about the structure of our data. Rather than treating each group as entirely independent, we can use our knowledge that these groups are drawn from a population-level distribution. We could formalise this as saying that the group-level slopes and intercepts are modeled as deflections from a population-level slope and intercept, respectively." |
1446 | 1446 | ]
|
1447 | 1447 | },
|
1448 | 1448 | {
|
|
1452 | 1452 | "And we could describe this model mathematically as:\n",
|
1453 | 1453 | "\n",
|
1454 | 1454 | "$$\n",
|
1455 |
| - "% \\begin{aligned}\n", |
1456 |
| - "% \\beta_0 &\\sim \\text{Normal}(0, 1) \\\\\n", |
1457 |
| - "% \\beta_1 &\\sim \\text{Normal}(0, 1) \\\\\n", |
1458 |
| - "% p_{0\\sigma}, p_{1\\sigma} &\\sim \\text{Gamma}(2, 2) \\\\\n", |
1459 |
| - "% \\vec{u_0} &\\sim \\text{Normal}(0, p_{0\\sigma}) \\\\ \n", |
1460 |
| - "% \\vec{u_1} &\\sim \\text{Normal}(0, p_{1\\sigma}) \\\\ \n", |
1461 |
| - "% \\sigma &\\sim \\text{Gamma}(2, 2) \\\\\n", |
1462 |
| - "% \\mu_i &= \\overbrace{\\Big( \\underbrace{\\beta_0}_{\\text{pop}} + \\underbrace{\\vec{u_0}[g_i]}_{\\text{group}} \\Big)}^{\\text{intercept}} \n", |
1463 |
| - "% + \\overbrace{\\Big( \\underbrace{\\beta_1[g_i] \\cdot x_i}_{\\text{pop}} + \\underbrace{\\vec{u_1}[g_i] \\cdot u_i }_{\\text{group}}\\Big) }^{\\text{slope}}\\\\\n", |
1464 |
| - "% y_i &\\sim \\text{Normal}(\\mu_i, \\sigma)\n", |
1465 |
| - "% \\end{aligned}\n", |
1466 | 1455 | "\\begin{aligned}\n",
|
1467 | 1456 | "\\beta_0 &\\sim \\text{Normal}(0, 1), \\\\\n",
|
1468 | 1457 | "\\beta_1 &\\sim \\text{Normal}(0, 1), \\\\\n",
|
|
1479 | 1468 | " + \\overbrace{\n",
|
1480 | 1469 | " \\left( \n",
|
1481 | 1470 | " \\underbrace{\\beta_1 \\cdot x_i}_{\\text{pop}} \n",
|
1482 |
| - " + \\underbrace{\\vec{u_1}[g_i] \\cdot u_i}_{\\text{group}} \n", |
| 1471 | + " + \\underbrace{\\vec{u_1}[g_i] \\cdot x_i}_{\\text{group}} \n", |
1483 | 1472 | " \\right)\n",
|
1484 | 1473 | " }^{\\text{slope}}, \\\\\n",
|
1485 | 1474 | "y_i &\\sim \\text{Normal}(\\mu_i, \\sigma).\n",
|
|
0 commit comments