## sw-r4oj4y44oh74v3s0782a
## reproductive adult survival, all data, no woodymono, no correlation
## Random Inits: TRUE
## Inits object: randomInits
## Total minutes: 1205.12
## Total iterations: 325000
## n_chain: 6
## n_adapt: 5000
## n_burn: 20000
## n_draw: 50000
## n_thin: 50
## Total samples kept: 6000
## Extended burnin: FALSE
## convergence: TRUE
## ppc: 0.5018
## db_hash: compadre 4.0.2 + unpublished trait data
model {
# priors
mu_alpha ~ dnorm(0, 0.001)
mu_beta ~ dnorm(0, 0.001)
sigma_alpha ~ dunif(.01, upper_alpha)
sigma_beta ~ dunif(.01, upper_beta)
sigma_spp ~ dunif(.01, upper_spp)
sigma_pop ~ dunif(.01, upper_pop)
tau_alpha <- pow(sigma_alpha, -2)
tau_beta <- pow(sigma_beta, -2)
tau_spp <- pow(sigma_spp, -2)
tau_pop <- pow(sigma_pop, -2)
lambda ~ dunif(0, 1)
for (k in 1:nlfs){
alpha[k] ~ dnorm(mu_alpha, tau_alpha)
beta[k] ~ dnorm(mu_beta, tau_beta)
}
# likelihood
# species model
z_species[1:nspp] ~ dmnorm(mu[], tau_phy[,])
for(j in 1:nspp) {
mu[j] <- alpha[lifeform[j]] + beta[lifeform[j]] * height[j]
}
# population model
for (i in 1:length(y)) {
y[i] ~ dnorm(z_species[species[i]], tau_pop)
rnew[i] ~ dnorm(z_species[species[i]], tau_pop)
rsqActual[i] <- pow(y[i] - z_species[species[i]], 2)
rsqNew[i] <- pow(rnew[i] - z_species[species[i]], 2)
}
# phylogenetic var-cov matrix
Mlam <- lambda * Amat + (1 - lambda) * ID
tau_phy <- tau_spp * inverse(Mlam)
# derived quantities
for (j in 1:nspp) {
z[j] <- ifelse(survival == 0, z_species[j], exp(z_species[j]) / (1 + exp(z_species[j])))
}
# posterior predictive check
zActual <- sum(rsqActual[])
zNew <- sum(rsqNew[])
test <- step(zNew - zActual)
bpvalue <- mean(test)
}
model {
# priors
mu_alpha ~ dnorm(3.1434, 1/1.0440^2)
mu_beta ~ dnorm(0.3460, 1/0.5139^2)
sigma_alpha ~ dgamma(1.8226^2/0.8173^2, 1.8226/0.8173^2)
sigma_beta ~ dgamma(0.6362^2/0.6967^2, 0.6362/0.6967^2)
sigma_spp ~ dgamma(1.8396^2/0.1621^2, 1.8396/0.1621^2)
sigma_pop ~ dgamma(1.3593^2/0.0207^2, 1.3593/0.0207^2)
tau_alpha <- pow(sigma_alpha, -2)
tau_beta <- pow(sigma_beta, -2)
tau_spp <- pow(sigma_spp, -2)
tau_pop <- pow(sigma_pop, -2)
for (k in 1:nP){
vgamma[k] ~ dnorm(0, 0.001)
}
for (k in 1:nlfs){
alpha[k] ~ dnorm(mu_alpha, tau_alpha)
eps.alpha[k] <- alpha[k] - mu_alpha
beta[k] ~ dnorm(0, tau_beta)
}
# likelihood
# species model
for(j in 1:nspp) {
z_species[j] ~ dnorm(mu[j], tau_spp)
mu[j] <- alpha[lifeform[j]] + mu_beta * height[j] + beta[lifeform[j]] * height[j] + phylo[j]
eps.spp[j] <- z_species[j] - mu[j]
}
phylo <- P %*% vgamma[]
# population model
for (i in 1:length(y)) {
y[i] ~ dnorm(z_species[species[i]], tau_pop)
rnew[i] ~ dnorm(z_species[species[i]], tau_pop)
rsqActual[i] <- pow(y[i] - z_species[species[i]], 2)
rsqNew[i] <- pow(rnew[i] - z_species[species[i]], 2)
eps.pop[i] <- y[i] - z_species[species[i]]
}
# derived quantities
sd.lf <- sd(eps.alpha[])
sd.h <- abs(mu_beta)
sd.lfh <- sd(beta[])
sd.spp <- sd(eps.spp[])
sd.pop <- sd(eps.pop[])
for (i in 1:nP){
sd.P[i] <- abs(vgamma[i]) * sd(P[,i])
}
# posterior predictive check
zActual <- sum(rsqActual[])
zNew <- sum(rsqNew[])
test <- step(zNew - zActual)
bpvalue <- mean(test)
}
mean | sd | 2.5% | 50% | 97.5% | Rhat | n.eff | |
---|---|---|---|---|---|---|---|
alpha[1] | 3.3782 | 0.9773 | 1.5030 | 3.3516 | 5.3682 | 1.00 | 6116 |
alpha[2] | 1.6545 | 1.0458 | -0.3907 | 1.6504 | 3.7337 | 1.00 | 5340 |
alpha[3] | 1.3721 | 1.0129 | -0.5269 | 1.3379 | 3.4509 | 1.00 | 4768 |
alpha[4] | 3.6506 | 0.8384 | 2.0367 | 3.6295 | 5.3203 | 1.00 | 4946 |
alpha[5] | 3.2341 | 1.5399 | 0.1373 | 3.2339 | 6.2673 | 1.00 | 5632 |
alpha[6] | 4.3104 | 0.7544 | 2.8806 | 4.2962 | 5.7958 | 1.00 | 5461 |
alpha[7] | 4.4737 | 0.8060 | 2.9134 | 4.4423 | 6.0555 | 1.00 | 5470 |
beta[1] | 0.1182 | 0.2813 | -0.4879 | 0.1398 | 0.6232 | 1.00 | 5881 |
beta[2] | 0.2153 | 0.9813 | -2.0943 | 0.2807 | 2.1032 | 1.00 | 6279 |
beta[3] | 0.6115 | 1.1216 | -0.9172 | 0.3911 | 3.7190 | 1.00 | 4829 |
beta[4] | 0.5514 | 0.5920 | -0.4341 | 0.4432 | 2.0175 | 1.00 | 5759 |
beta[5] | 0.3359 | 1.0034 | -1.6429 | 0.3194 | 2.5552 | 1.00 | 5827 |
beta[6] | 0.1823 | 0.3543 | -0.6026 | 0.2114 | 0.8289 | 1.00 | 5905 |
beta[7] | 0.4176 | 0.1719 | 0.0860 | 0.4161 | 0.7625 | 1.00 | 6162 |
mu_alpha | 3.1434 | 1.0440 | 1.0666 | 3.1387 | 5.2115 | 1.00 | 5321 |
mu_beta | 0.3460 | 0.5139 | -0.5828 | 0.3170 | 1.5743 | 1.00 | 6139 |
sigma_alpha | 1.8226 | 0.8173 | 0.8000 | 1.6393 | 4.0309 | 1.00 | 6338 |
sigma_beta | 0.6362 | 0.6967 | 0.0306 | 0.4123 | 2.6322 | 1.01 | 3756 |
sigma_spp | 1.8396 | 0.1621 | 1.5653 | 1.8261 | 2.1964 | 1.00 | 6474 |
sigma_pop | 1.3593 | 0.0207 | 1.3195 | 1.3592 | 1.4008 | 1.00 | 5874 |
lambda | 0.5199 | 0.1106 | 0.3008 | 0.5236 | 0.7218 | 1.00 | 5787 |
Of the 375 species modeled, the latent response variables converged for 100% of them.
Fig. S2-2: Scatterplot of summed squared residuals between observed and predicted adult survival (logit transformed) and between simulated and predicted adult survival (logit transformed) at each MCMC iteration for each population. The Bayesian posterior predictive check p-value was 0.50.
Fig. S1-3: Adult survival probabilities (\(z_{j}\), Eqn. 1) for all modeled species, ordered by magnitude. Thick lines represent the 50% equal-tailed credible intervals, thin lines represent the 95% equal-tailed credible intervals, and circles are the posterior medians.
Fig. S1-4: Parameter estimates for \(\alpha_{m}\) (Eqn. 1) showing adult survival (logit transformed) at average plant height (8 m). Thick lines represent the 50% equal-tailed credible intervals, thin lines represent the 95% equal-tailed credible intervals, and circles are the posterior medians.
Fig. S1-5: Parameter estimates for \(\beta_{m}\) (Eqn. 1) showing effects of a 1 SD change in plant height (15.6 m) on adult survival (logit transformed) by lifeform. Thick lines represent the 50% equal-tailed credible intervals, thin lines represent the 95% equal-tailed credible intervals, and circles are the posterior medians. Black estimates with closed circles represent 95% credible intervals that do not overlap zero, gray estimates with closed circles represent 50% credible intervals that do not overlap zero, and gray estimates with open circles represent 50% credible intervals that overlap zero.
Fig. S1-6: Adult survival rates (logit transformed) as a function of maximum plant height (in meters) by lifeform. The gray shaded areas represent the 95% equal-tailed credible intervals and the red lines are the posterior medians for the fitted relationship. Filled circles are the medians and black vertical bars are the 95% equal-tailed credible intervals for the adult survival (logit transformed) of each species (\(z_{j}\)).
Fig. S1-7: Results from the Bayesian analysis of variance showing the finite-population standard deviation for each source of variation (lifeform, plant height, interaction between lifeform and plant height, the five most important phylogeny vectors, unexplained variation among species, unexplained variation among populations) for adult survivorship (logit transformed). For simplicity we show only the five phylogeny vectors with the largest finite standard deviation values, as all other phylogeny vectors had minimal variance components. Larger values indicate a higher proportion of variation explained by the source. Filled circles represent the median, thick bars indicate the 50% credible interval, and thin bars indicate the 95% credible interval for each estimate.
Fig. S1-8: Predicted adult survival rates based on biological traits and phylogenetic relatedness for five focal plant species (Abies concolor - 5 populations in dataset, Astragalus alopecurus - 16, Bothriochloa ischaemum - 6, Cecropia obtusifolia - 4, and Frasera speciosa - 25). “Fitted” values (gray bars) are the posterior distributions for the estimated adult survival rate when data for all species were included in the model, whereas “Predicted” values (black bars) are when data for the focal species were excluded. Open circles indicate the observed adult survival rates from each population of the species. Filled circles indicate the median, thick bars indicate the 50% credible interval, and thin bars indicate the 95% credible interval for each estimate.