DOI-USGS / streamMetabolizer

streamMetabolizer uses inverse modeling to estimate aquatic metabolism (photosynthesis and respiration) from time series data on dissolved oxygen, water temperature, depth, and light.
http://usgs-r.github.io/streamMetabolizer/
Other
36 stars 22 forks source link

Calculation of SD and CI in get_params #381

Closed PsaltakisJ closed 4 years ago

PsaltakisJ commented 4 years ago

Hi!

I have a question regarding the standard deviation and confidence interval bounds that are reported alongside daily estimates of GPP, ER, and K600 in get_params.

How are these metrics of parameter uncertainty calculated? Are they based on the entire number of steps run across all chains? Or some other method? I am trying to assess model performances of using different parameters for the same dataset, and am trying to better understand the modeled metrics of metabolism.

robohall commented 4 years ago

If you consider the MCMC steps samples from the posterior probability distribution of the parameter, the error bars are the 2.5% and 97.5% quantiles of the MCMC steps after the burn-in, thus they represent the 95% area of the posterior probability of the parameter. How many steps depends on what you selected in the specs part of the model specification.

Bob Hall

On Nov 1, 2019, at 9:43 AM, PsaltakisJ notifications@github.com<mailto:notifications@github.com> wrote:

Hi!

I have a question regarding the standard deviation and confidence interval bounds that are reported alongside daily estimates of GPP, ER, and K600 in get_params.

How are these metrics of parameter uncertainty calculated? Are they based on the entire number of steps run across all chains? Or some other method? I am trying to assess model performances of using different parameters for the same dataset, and am trying to better understand the modeled metrics of metabolism.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/USGS-R/streamMetabolizer/issues/381?email_source=notifications&email_token=AC4CU5VBXS6MRJZ7XFSB2MTQRRFA7A5CNFSM4JH4PAB2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HWEOQ2A, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC4CU5XKETT547F2KYBUD6DQRRFA7ANCNFSM4JH4PABQ.

aappling-usgs commented 4 years ago

For Bayesian models, these metrics are computed based on the empirical distribution of the MCMC chains after the burn-in period (the saved_steps only). The standard deviation (get_params(mm, uncertainty='sd')) is the standard deviation of the values selected by those chains. The .lower and .upper interval bounds (get_params(mm, uncertainty='ci')) are the 95% credible interval bounds.

(Just saw Bob's reply above - yeah, what he said!)

PsaltakisJ commented 4 years ago

Thank you! The explanation of the warm-up steps and saved steps really cleared things up.