Various R and JAGS code is available on my github. In particular, I maintain code for estimating aquatic ecosystem metabolism from high-frequency measurements of dissolved oxygen in rivers and lakes. Please don’t hesitate to contact me with any problems and suggestions for improvements are always welcome.
BASEmetab R package
BASEmetab is an R package to quickly estimate single-station stream metabolism from long time series of dissolved oxygen data. It operates in a batch mode to model metabolic parameters for many days without repeated user input. The package was written in collaboration with Mike Grace, Ralph Mac Nally and Nick Bond. The model uses Bayesian methods to simultaneously estimate GPP, ecosystem respiration and the reaeration coefficient K, along with their uncertainties. Prior information from independent measures of K can be optionally incorporated. The model output provides metrics and plots to assess model fit.