knitr::opts_chunk$set(echo = TRUE) options(width=80) library(streamMetabolizer)
Many model structures are available in the streamMetabolizer package. These fall into three general type
s:
bayes
- Inverse Bayesian modeling of GPP, ER, and K600mle
- Inverse modeling by maximum likelihood estimation of GPP, ER, and optionally K600night
- Nighttime regression for estimation of K600 and ERTwo additional model type
s can be useful in specific situations:
Kmodel
- Builds a multi-day relationship between K600 and predictor variables; can be used in conjunction with mle
and/or night
sim
- Simulates dissolved oxygen "data" for model testingA complete specification of a model structure begins with a basic type
but
also includes other information about the model error assumptions, any
hierarchical components, the numerical integration method, the process equations
used to describe GPP and ER, and more. A model structure is fully specified by a
concise if cryptic model name. Examples are "b_np_oipi_tr_plrckm.stan" and
"m_np_oi_tr_plrckm.nlm". You never need to remember these concise names;
instead, you can construct and interpret such names using the mm_name
and
mm_parse_name
functions, respectively.
The mm_name()
function creates a cryptic (but complete and concise) model name from several options that you can specify. For example:
mm_name(type='bayes') # the default Bayesian model mm_name(type='bayes', pool_K600='normal') # a Bayesian model with simple pooling of K600 to a shared mean mm_name(type='mle') # the default MLE model mm_name(type='mle', ode_method='euler') # an MLE model with a simpler ode_method
See the help file at ?mm_name
to learn about the structural options that you can adjust.
The mm_parse_name()
function splits a cryptic model name into its component features. For example:
mm_parse_name(c('b_np_oipi_tr_plrckm.stan', 'm_np_pi_tr_psrqkm.nlm'))
See the help file at ?mm_parse_name
, and refer again to ?mm_name
for definitions of the column names in the output of mm_parse_name
.
You can see the full list of available model structures by
calling mm_valid_names()
(here we'll just print a sampling of the full list):
valid_names <- mm_valid_names(type=c('bayes','mle','night')) length(valid_names) c(valid_names[seq(1,length(valid_names),length.out=20)], '...')
Once you have a model name in hand, pass that name to metab()
to fit a model with the selected structure. See the Quickstart tutorial for more.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.