DOI-USGS / DOI-USGS/streamMetabolizer

Starting DO values for predict_DO

Open
#415 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Stan
Stars
47
Forks
25
PR merge metrics
No merged PRs in 30d

Description

Hi Alison,

If I understand correctly, both predict_DO and metab_sim with mm_name("sim") use the first observed DO value at the start of each day, then use the model to predict DO from that point on. Is there a way to modify this behavior? I'd like to modify the function so it still begins with the first DO observation on the first day, but on each successive day it ignores observed DO and instead begins with the predicted DO value at the end of the previous day. In other words, I'd like predicted DO for multiple days to be continuously predicted, rather than returning to observed DO at the start of each day. I've tried poking around through code in these and related functions, but haven't been able to figure out where this is controlled.

More details about why I'm doing this: I'm working with a river dominated by macrophytes and I have estimates of how metabolism would change if the plants were intensively harvested. From these estimates, I've reduced GPP and ER in the parameters extracted from the metabolism model. This gives me two sets of parameters: one for current conditions and one that simulates reduced metabolism due to reduced plant abundance. I'd like to plot DO predictions for each of these scenarios, which will give me an estimate of how DO might change under the management scenario. I'm able to predict DO for the metabolism model with unmodified parameters and the values I get are quite close to observed DO. When I predict DO for the reduced parameters, at the end of a given day during the baseflow period, predicted DO is ~ 1 mg/L higher than observed DO. However, at the next time step, DO drops back down to the observed value. I'd like to modify the code so predicted DO at the first timestep begins with predicted DO at the final timestep the previous day.

Is what I'm trying to do reasonable? I assume the reason the predict_DO function uses the observed value at the start of the day is because the further the predictions are from that point, the less reliable they are.

Graphically, here's my issue. Predicted DO based on parameters from my metabolism model:
![image](https://user-images.githubusercontent.com/95452481/165998124-79ad8c89-2a24-4c64-837e-654124339bc9.png)

Predicted DO based on reduced GPP and ER parameters: Predicted DO at the end of each day is ~6 mg/L, but jumps to ~4.5 mg/L at the next time step, which was the observed value. I'd like to find a way to keep the predictions continuous.
![image](https://user-images.githubusercontent.com/95452481/165998287-b6e9b7a3-49d0-43fc-99b4-96e7d4b4f9c3.png)

Contributor guide

Open the contributing guide

Research direction

Start by tracing the predict_DO and metab_sim functions when using mm_name("sim"), focusing on where each day's initial DO value is selected. Confirm how the first day's observed value and subsequent daily resets are handled; done means predictions begin with the first observed value only once and then carry the previous day's final predicted DO forward continuously.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.