Created
June 29, 2021 11:12
-
-
Save rmcelreath/6eb3c96ac52d53ae8f972e8fbf88e30d to your computer and use it in GitHub Desktop.
Code example for RFDT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# version that marginalizes out the missing data | |
flbi_plus <- ulam( | |
alist( | |
c(M,D) ~ multi_normal( c(mu,nu) , Rho , Sigma ), | |
mu <- a1 + b*B1, | |
nu <- a2 + b*B2 + m*M, | |
c(a1,a2,b,m) ~ normal( 0 , 0.5 ), | |
Rho ~ lkj_corr( 2 ), | |
Sigma ~ exponential( 1 ) | |
), data=dat , chains=4 , cores=4 , cmdstan=TRUE ) | |
precis(flbi_plus,3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment