-
Notifications
You must be signed in to change notification settings - Fork 25
Two station static model: Stan file, data, data prep, implementation #469
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
dce238b
Add static two-station Stan model
mdodrill-usgs b99fa34
Add two-station data spec, validator stub, and constructor stub
mdodrill-usgs d8a1d04
Add mm_ts_prep_data() with upstream lag shift
mdodrill-usgs 8246c91
Add predict_DO.metab_2station stub and fix mm_parse_name for b2_ prefix
mdodrill-usgs d8cb70e
Update two-station Stan model: parameter naming and priors
mdodrill-usgs 033e9d6
Implement metab_2station() with specs, dispatch, example data, and tests
mdodrill-usgs c76e7d6
Fix R CMD CHECK NOTEs in metab_2station.R
mdodrill-usgs a6eb23b
Rename metab_2station -> metab_bayes_2s, mm_ts_prep_data -> prepdata_…
mdodrill-usgs 2074de0
Consolidate two-station validation into mm_validate_data_2station()
mdodrill-usgs 8841358
Move K600_lnorm_meanlog/sdlog defaults into specs()
mdodrill-usgs 5f3030e
Extract shared matrix-pivot/contiguous-sort logic
mdodrill-usgs 4103b71
Extract shared core-count logic into mm_determine_cores()
mdodrill-usgs 13b8c8f
Align failed-Stan-run behavior in metab_bayes_2s() with one-station
mdodrill-usgs d270bfe
Fix units notation to unitted-style
mdodrill-usgs 8a81e49
Fix stale bayes_allply() data_all doc
mdodrill-usgs e562338
Add attach.units deprecation support to predict_metab.metab_bayes_2s()
mdodrill-usgs 4326791
Doc-trim pass on branch's own roxygen (fix/vfts-stan-syntax)
mdodrill-usgs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| #' Example two-station (VFTS) input data | ||
| #' | ||
| #' A 30-day example dataset for fitting a two-station (upstream/downstream, | ||
| #' Variable Flow Two-Station) metabolism model with | ||
| #' \code{\link{metab_bayes_2s}}. It is a subset of the \code{VFTS-2} | ||
| #' (variable-travel-time) run from the published two-station metabolism modeling | ||
| #' dataset for a reach of the Colorado River in Glen Canyon, covering 2011-07-31 | ||
| #' through 2011-08-29 at the source data's native 15-minute timestep, plus a | ||
| #' lead-in block of upstream DO observations (exactly as long as the longest | ||
| #' travel time in the dataset requires -- see \code{\link{metab_bayes_2s}}'s | ||
| #' "Two-station data requirements" section) immediately before 2011-07-31. | ||
| #' | ||
| #' @format A data.frame with 2904 rows and the 9 columns expected by | ||
| #' \code{\link{metab_bayes_2s}}'s \code{data} argument, each carrying | ||
| #' \code{\link[unitted]{unitted}} units matching \code{\link{mm_data}}: | ||
| #' \describe{ | ||
| #' \item{solar.time}{POSIXct timestamp, UTC} | ||
| #' \item{DO.obs.up}{dissolved oxygen observed at the upstream station, | ||
| #' mgO2 L^-1} | ||
| #' \item{DO.sat.up}{dissolved oxygen at equilibrium saturation at the | ||
| #' upstream station, mgO2 L^-1} | ||
| #' \item{DO.obs.down}{dissolved oxygen observed at the downstream | ||
| #' station, mgO2 L^-1} | ||
| #' \item{DO.sat.down}{dissolved oxygen at equilibrium saturation at the | ||
| #' downstream station, mgO2 L^-1} | ||
| #' \item{light}{photosynthetically active radiation, umol m^-2 s^-1} | ||
| #' \item{depth}{reach depth, m} | ||
| #' \item{temp.water}{water temperature at the downstream station, degC} | ||
| #' \item{travel.time}{reach travel time between the upstream and | ||
| #' downstream stations, d} | ||
| #' } | ||
| #' | ||
| #' @source Filtered to \code{model_run == 'VFTS-2'}; see | ||
| #' \code{data-raw/two_station_example.R} for the extraction/renaming code. | ||
| #' | ||
| #' Bishop, I.W., Deemer, B.R., Kennedy, T.A., Payn, R.A., Hall Jr, R.O. and | ||
| #' Yackulic, C.B., 2026. A simplified two-station approach for modeling | ||
| #' metabolism in dam tailwaters subject to diel flow variation. Limnology | ||
| #' and Oceanography: Methods, p.e70066. | ||
| #' \url{https://aslopubs.onlinelibrary.wiley.com/doi/pdf/10.1002/lom3.70066} | ||
| #' | ||
| #' Data archived at ScienceBase: | ||
| #' \url{https://www.sciencebase.gov/catalog/item/6887d457d4be024722b4aae2} | ||
| "two_station_example" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.