Open aappling-usgs opened 8 years ago
cool trick: can already extract inst GPP, ER, and DO_mod from bayesian models if you ask for them ahead of time. below, plot_DO_preds() uses calc_dDOdt rather than mcmc output to compute the brown line, but the black line from bayesian model nonetheless plots right on top, as it should.
mm1 <- metab(revise(specs("b_np_oi_tr_plrckm.stan"), params_out=c(params_out, 'GPP', 'ER', 'DO_mod')), dat)
plot_DO_preds(mm1, y_var='conc') + geom_line(data=get_fit(mm1)$inst, aes(x=solar.time, y=DO_mod_50pct), size=1.5, linetype='dashed')
and here are the instantaneous GPP & ER
ggplot(get_fit(mm1)$inst, aes(x=solar.time)) + geom_line(aes(y=GPP_50pct), color='forestgreen') + geom_line(aes(y=ER_50pct), color='brown') + theme_bw() + ylab("GPP (green) and ER (brown) (gO2 m^-2 d^-1)")
someday would be neat to offer predictions of GPP, ER, and D at each timestep, offer plotting, etc.