5.5 Marginalized likelihood of an individual response vector

The marginalized likelihood observing a response vector Yi for student i is L(Yi)=cL(Yi|αi=αc)p(αc)

Recall that L(Yi|α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)=16 and p(01)=p(11)=13. Verify that L(Y2)=.0094.

Click for Answer

Note that

L(Yi)=cL(Yi|αi=αc)p(αc)

Code
# population proportions
p.alphac <- c(1/6, 1/6, 1/3, 1/3)
L2 <- sum(Li.given.alpha.c[2, ] * p.alphac)
L2
## [1] 0.0094