Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phylogenetic imputation of a binary predictor #7

Open
tbendixen opened this issue Mar 31, 2023 · 0 comments
Open

phylogenetic imputation of a binary predictor #7

tbendixen opened this issue Mar 31, 2023 · 0 comments

Comments

@tbendixen
Copy link

Thanks for yet another round of awesome lectures!

I have a question about the imputation procedure in the missing data lecture.

So, in the following model, the primate phylogeny is used to impute missing data in predictor G (group size).

mBMG_OU3 <- ulam(
    alist(
        B ~ multi_normal( mu , K ),
        mu <- a + bM*M + bG*G,
        G ~ multi_normal( nu , KG ),
        nu <- aG + bMG*M,
        M ~ normal(0,1),
        matrix[N_spp,N_spp]:K <- cov_GPL1(Dmat,etasq,rho,0.01),
        matrix[N_spp,N_spp]:KG <- cov_GPL1(Dmat,etasqG,rhoG,0.01),
        c(a,aG) ~ normal( 0 , 1 ),
        c(bM,bG,bMG) ~ normal( 0 , 0.5 ),
        c(etasq,etasqG) ~ half_normal(1,0.25),
        c(rho,rhoG) ~ half_normal(3,0.25)
    ), data=dat_all , chains=4 , cores=4 , sample=TRUE )

My question is, what if G was a binary predictor? For instance, we might code a species either as solitary (S=0) or social (S=1) and use that to predict brain size B. We then want to use phylogenetic information in the imputation of S.

My guess is that the likelihood for S would not be multivariate normal, but how would the code look like then?

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant