eggsLMod <- map2stan(alist( | |
Eggs_laid ~ dpois(lambda), | |
log(lambda) <- a + a_fem[female_id] + a_year[year_id] + a_group[group_id] + | |
Parasite*bP + Min_age_Z*bA + Group_size_Z*bGS + Mean_eggsize_Z*bES + | |
Parasite*Min_age_Z*bPA, | |
Group_size_Z ~ dnorm(0, 3), | |
Mean_eggsize_Z ~ dnorm(0, 3), | |
a_fem[female_id] ~ dnorm(0, sigma1), | |
a_year[year_id] ~ dnorm(0, sigma2), | |
a_group[group_id] ~ dnorm(0, sigma3), | |
c(sigma1, sigma2, sigma3) ~ dcauchy(0, 1), | |
a ~ dnorm(0, 3), | |
c(bP, bA, bGS, bES, bPA) ~ dnorm(0, 2)), | |
data = froReduced, | |
iter = 5e3, warmup = 1e3, chains = 4, cores = 4) | |
# Check posterior dists | |
precis(eggsLMod, prob = .95) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment