5.5 Marginalized likelihood of an individual response vector
The marginalized likelihood observing a response vector \(\mathbf{Y}_i\) for student \(i\) is \[\begin{equation} L({\mathbf{Y}_i})=\sum_cL( {\mathbf{Y}_i}|{\alpha_i=\alpha_c})p(\mathbf{\alpha}_c) \end{equation}\]
Recall that \(L( {\mathbf{Y}_i}|{\mathbf{\alpha} _c})\) is
Code
Li.given.alpha.c
## 00 10 01 11
## student 1 0.00081 0.00144 0.00144 0.0205
## student 2 0.00729 0.01296 0.01296 0.0051
## student 3 0.00081 0.00004 0.05184 0.0205
## student 4 0.00081 0.05184 0.00144 0.0205
## student 5 0.00729 0.01296 0.00036 0.0051
## student 6 0.00729 0.00036 0.01296 0.0051
## student 7 0.00729 0.01296 0.01296 0.0051
## student 8 0.00009 0.00016 0.00576 0.0819
## student 9 0.00081 0.05184 0.00144 0.0205
## student 10 0.00081 0.00144 0.00144 0.0205
Exercise 5.2 Let us assume \(p(00)=p(10)=\frac{1}{6}\) and \(p(01)=p(11)=\frac{1}{3}\). Verify that \(L({\mathbf{Y}_2})=.0094\).
Click for Answer
Note that
\[\begin{equation} L({\mathbf{Y}_i})=\sum_cL( {\mathbf{Y}_i}|{\alpha_i=\alpha_c})p(\mathbf{\alpha}_c) \end{equation}\]
Code
# population proportions
<- c(1/6, 1/6, 1/3, 1/3)
p.alphac <- sum(Li.given.alpha.c[2, ] * p.alphac)
L2 L2
## [1] 0.0094