Skip to content

Instantly share code, notes, and snippets.

@rmcelreath
Created Jun 29, 2021
Embed
What would you like to do?
Code example for RFDT
# 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