View source: R/metab.bayesian.R
metab.bayesian | R Documentation |
This function runs the bayesian metabolism model on the supplied gas concentration and other supporting data. This allows for both estimates of metabolism along with uncertainty around the parameters.
metab.bayesian(do.obs, do.sat, k.gas, z.mix, irr, wtr, priors, ...)
do.obs |
Vector of dissovled oxygen concentration observations, mg L^-1 |
do.sat |
Vector of dissolved oxygen saturation values based on water temperature. Calculate using o2.at.sat |
k.gas |
Vector of kGAS values calculated from any of the gas flux models (e.g., k.cole) and converted to kGAS using k600.2.kGAS |
z.mix |
Vector of mixed-layer depths in meters. To calculate, see ts.meta.depths |
irr |
Vector of photosynthetically active radiation in micro mols / m^2 / s |
wtr |
Vector of water temperatures in degrees C. Used in scaling respiration with temperature |
priors |
Parameter priors supplied as a named numeric vector (example: c("gppMu"=0, "gppSig2"=1E5, "rMu"=0, "rSig2"=1E5, "kSig2"=NA)) |
... |
additional arguments; currently "datetime" is the only recognized argument passed through |
A list of length 4 with components:
model |
the jags model, including posterior draws (see jags) |
params |
parameter estimates of interest from model (medians) |
metab.sd |
standard deviation of metabolism estimates |
metab |
daily metabolism estimates as a data.frame with columns corresponding to
|
Ryan Batt, Luke A. Winslow
Holtgrieve, Gordon W., Daniel E. Schindler, Trevor a. Branch, and Z. Teresa A'mar. 2010. Simultaneous Quantification of Aquatic Ecosystem Metabolism and Reaeration Using a Bayesian Statistical Model of Oxygen Dynamics. Limnology and Oceanography 55 (3): 1047-1062. doi:10.4319/lo.2010.55.3.1047. http://www.aslo.org/lo/toc/vol_55/issue_3/1047.html.
metab.mle, metab.bookkeep, metab.kalman
## Not run: library(rLakeAnalyzer) doobs = load.ts(system.file('extdata', 'sparkling.doobs', package="LakeMetabolizer")) wtr = load.ts(system.file('extdata', 'sparkling.wtr', package="LakeMetabolizer")) wnd = load.ts(system.file('extdata', 'sparkling.wnd', package="LakeMetabolizer")) irr = load.ts(system.file('extdata', 'sparkling.par', package="LakeMetabolizer")) #Subset a day mod.date = as.POSIXct('2009-07-08', 'GMT') doobs = doobs[trunc(doobs$datetime, 'day') == mod.date, ] wtr = wtr[trunc(wtr$datetime, 'day') == mod.date, ] wnd = wnd[trunc(wnd$datetime, 'day') == mod.date, ] irr = irr[trunc(irr$datetime, 'day') == mod.date, ] k600 = k.cole.base(wnd[,2]) k.gas = k600.2.kGAS.base(k600, wtr[,3], 'O2') do.sat = o2.at.sat(wtr[,1:2], altitude=300) metab.bayesian(irr=irr[,2], z.mix=rep(1, length(k.gas)), do.sat=do.sat[,2], wtr=wtr[,2], k.gas=k.gas, do.obs=doobs[,2]) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.