Model run

## sw-yl4foixn2y5joivdhsx9 
## recruit survival, all data, no woodymono, no correlation 
## Random Inits: TRUE 
## Inits object: randomInits 
## Total minutes: 1381.01 
## 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.5082
## db_hash: compadre 4.0.2 + unpublished trait data

JAGS code

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)   

}

PVR JAGS code

model {

# priors
mu_alpha ~ dnorm(-0.0294, 1/0.6468^2)
mu_beta ~ dnorm(0.2903, 1/0.3478^2)

sigma_alpha ~ dgamma(0.3956^2/0.3355^2,  0.3956/0.3355^2)
sigma_beta ~ dgamma(0.4533^2/0.4182^2, 0.4533/0.4182^2)
sigma_pop ~ dgamma(1.0945^2/0.0156^2, 1.0945/0.0156^2)
sigma_spp ~ dgamma(2.1369^2/0.1399^2, 2.1369/0.1399^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)   

}

Convergence/Identifiablity

mean sd 2.5% 50% 97.5% Rhat n.eff
alpha[1] -0.0283 0.6937 -1.4579 -0.0205 1.3226 1 4011
alpha[2] -0.0610 0.7136 -1.5175 -0.0564 1.3403 1 4010
alpha[3] -0.2426 0.7127 -1.7199 -0.2220 1.1037 1 4195
alpha[4] -0.0215 0.6584 -1.3546 -0.0150 1.2774 1 3711
alpha[5] -0.1346 0.7764 -1.7736 -0.1160 1.3524 1 3969
alpha[6] 0.1331 0.6293 -1.0909 0.1356 1.3773 1 3819
alpha[7] 0.1493 0.6432 -1.0959 0.1318 1.4352 1 3747
beta[1] 0.4324 0.2500 -0.0097 0.4119 0.9724 1 5264
beta[2] 0.2706 0.6026 -1.0238 0.2714 1.5387 1 6157
beta[3] 0.4545 0.6260 -0.6100 0.3666 2.0174 1 5867
beta[4] 0.1287 0.4576 -0.9564 0.1788 0.9439 1 5869
beta[5] 0.3912 0.6770 -0.7614 0.3127 2.0466 1 6280
beta[6] 0.1869 0.3376 -0.5566 0.2097 0.8225 1 6386
beta[7] 0.1737 0.1821 -0.1927 0.1731 0.5237 1 5584
mu_alpha -0.0294 0.6468 -1.3041 -0.0301 1.2341 1 3634
mu_beta 0.2903 0.3478 -0.4079 0.2778 1.0291 1 6269
sigma_alpha 0.3956 0.3355 0.0254 0.3127 1.2807 1 5735
sigma_beta 0.4533 0.4182 0.0254 0.3345 1.6053 1 5111
sigma_spp 2.1369 0.1399 1.9027 2.1240 2.4468 1 5886
sigma_pop 1.0945 0.0156 1.0642 1.0943 1.1260 1 5654
lambda 0.2801 0.1047 0.0880 0.2752 0.4943 1 5740

Of the 391 species modeled, the latent response variables converged for 100% of them.


Fig. S3-1: Trace plots of key model parameters.

Fit

Fig. S3-2: Scatterplot of summed squared residuals between observed and predicted recruit survival (logit transformed) and between simulated and predicted recruit survival (logit transformed) at each MCMC iteration for each population. The Bayesian posterior predictive check p-value was 0.51.

Species response

Fig. S3-3: Recruit 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.

Height parameters

Fig. S3-4: Parameter estimates for \(\alpha_{m}\) (Eqn. 1) showing recruit 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. S3-5: Parameter estimates for \(\beta_{m}\) (Eqn. 1) showing effects of a 1 SD change in plant height (15.6 m) on recruit 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. 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.

Survival vs. height

Fig. S3-6: Recruit 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 recruit survival rate (logit transformed) of each species (\(z_{j}\)).

ANOVA

Fig. S3-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 recruit 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.

Fitted vs. Predicted




Fig. S3-8: Predicted recruit 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 recruit 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 recruit 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.