Created
October 7, 2019 17:58
-
-
Save monogenea/ed5d24c66657a80e5f194e5af6c5eca7 to your computer and use it in GitHub Desktop.
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
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