I noticed from the speed-duration figure that responses in speed and duration are less correlated in closed canopy ambient rainfall compared to the other two contexts. I wondered if this was because this context had more replicates, hence allowing speed and duration to be better identified, or because there was less trade-off.
I therefore regenerate the figure after fitting models with approximately half of the data.
dat_shoot_alive <- dat_shoot %>%
drop_na(barcode) %>%
filter(shoot > 0) %>%
filter(!is.na(shoot)) %>%
group_by(barcode, year) %>%
mutate(shoot_alive = if_else(any(alive == 0), 0, 1)) %>% # filter out plants ever considered dead at any point in a year
ungroup() %>%
filter(shoot_alive == 1) %>%
select(-alive, -shoot_alive)
dat_all_less <- dat_shoot_alive %>%
filter(water_name == "ambient", canopy == "closed") %>%
filter(str_detect(plot, "1|2|3|4")) %>%
mutate(model = str_c(species, canopy, water_name, sep = "_")) %>%
group_by(species, model) %>%
mutate(individual = str_c(barcode, year, sep = "_") %>% factor() %>% as.integer()) %>% # individual level random effects)
mutate(group = str_c(site, year, sep = "_") %>% factor() %>% as.integer()) %>% # site-year level random effects
ungroup() %>%
tidy_treatment_code()
calc_bayes_all(
data = dat_all_less,
independent_priors = F, # do not use species-specific empirical informative priors
uniform_priors = T, # use uniform priors
intui_param = F, # regular parameterization with asym, xmid, logk
individual_trajectory = T, # individual level random effects
num_iterations = 50000,
nthin = 5,
path = "alldata/intermediate/shootmodeling/individual_less/",
num_cores = 17
)
calc_bayes_derived(path = "alldata/intermediate/shootmodeling/individual_less/", num_cores = 17, random = T, random_fast = T)
plot_bayes_all(path = "alldata/intermediate/shootmodeling/individual_less/", num_cores = 17)
df_bayes_mcmc <- read_bayes_all(path = "alldata/intermediate/shootmodeling/individual_less/", full_factorial = F, derived = T, tidy_mcmc = T, content = "mcmc")
df_mcmc <- df_bayes_mcmc %>%
tidy_species_name() %>%
tidy_model_name() %>%
mutate(value = value * (str_detect(param, "beta") + 1)) # effect of 3.4 degree C warming instead of 1.7 degree C
df_shoot_coef <- df_bayes_mcmc %>%
mutate(value = value * (str_detect(param, "beta") + 1)) %>% # effect of 3.4 degree C warming instead of 1.7 degree C
summ_mcmc(option = "all", stats = "median") %>%
tidy_species_name() %>%
tidy_model_name()
df_shoot_mu <- df_bayes_mcmc %>%
summ_mcmc(option = "mu", stats = "median") %>%
tidy_species_name() %>%
tidy_model_name()
plot_speed_duration(df_shoot_coef, df_shoot_mu, mu = F, ci = F, nrow = 1)
Not too different from original figure. I think the ellipses being more rounded in closed canopy means that there are more across-species variability in duration responses among deciduous trees compared to open canopy. However, this variability is driven by species like acene, etal, tilam that are only planted in closed canopy, but not by the same species.