Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO.mod in predict_DO for Bayesian model #391

Closed
Tzu-Yao opened this issue Jun 17, 2020 · 2 comments
Closed

DO.mod in predict_DO for Bayesian model #391

Tzu-Yao opened this issue Jun 17, 2020 · 2 comments

Comments

@Tzu-Yao
Copy link

Tzu-Yao commented Jun 17, 2020

Hi Alison and Bob,

First of all thank you so much for answering my questions in #390. Your insights are really helpful!
Here I'd like to raise another question about DO.mod in predict_DO. As I was trying to calculate the metric for goodness of fit using DO.mod and DO.obs, as described in #367, I'm not sure if this DO.mod from predict_DO has been corrected by process error already (I want to know what kinds of error the residuals contain).
Later I followed #222 and produced two plots, as below. The blue dashed line is DO.mod from mcmc results and the brown line is DO.mod calculated by calc_dDOdt. For the observation model ("b_Kb_oi_tr_plrckm.stan"), the two lines match, but for the state-space model ("b_Kb_oipi_tr_plrckm.stan"), they don't. So I was wondering if this difference is caused by the correction of process error in mcmc calculation. In other words, DO.mod in predict_DO (brown line) does not account for process error?

DO_plots_obs-err_DO pred vs DO mod
The observation error Bayesian model

DO_plots_state-space_DO pred vs DO mod
The state-space Bayesian model

Thank you,
Tzu-Yao

@aappling-usgs
Copy link
Collaborator

Your interpretation of the software behavior is correct - predict_DO returns predictions for DO that are not corrected for process error, which is why the observation-error-only models show better matches between the observations and the output of that function.

I've had open issues for a couple of years to add in process error corrections within predict_DO (#294, #330). Given that I am no longer actively developing the package, they're not likely to be resolved soon. Fortunately, you can already get the process-error-corrected predictions by requesting that they be tracked in Stan (they're called DO_mod):

revise(specs, params_out=c(params_out, 'DO_mod'))

Then you just need to pull these DO_mod values out of the instantaneous data.frame within the model fit.

@Tzu-Yao
Copy link
Author

Tzu-Yao commented Jun 17, 2020

Thank you so much Alison!

@Tzu-Yao Tzu-Yao closed this as completed Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants