9  Adding uncertainty to forecasts

The forecast you generated in Chapter 8 included uncertainty due to future weather. As you learned in Chapter 3, many other sources of uncertainty could be included in your forecast. Your task is to apply the techniques in Chapter 3 to generate additional sources of uncertainty in the forecast model from Chapter 8. When you are finished, your model from Chapter 8 should have driver, parameter, and process uncertainty. You will submit the assignment as an updated GitHub repository with the code and plot of your forecast with all uncertainty sources included.

You will generate forecasts of water temperature at NEON Aquatics sites, with estimated uncertainty.

A version of the template from Chapter 8 is provided that recodes the template to match the approach in Chapter 3. You should add your model from Chapter 8 to this template before adding the uncertainty sources from Chapter 3. In the updated template, you will notice two new “for-loops” that iterate over the forecast dates and ensemble members. These loops, while less efficient than the original code in forecast_code_template.R, are designed to be more explicit about the individual calculations for each ensemble member. Refactoring code this way makes it easier to transition to process-based models and models with lagged variables.

9.1 Reading

Thomas, R. Q., Boettiger, C., Carey, C. C., Dietze, M. C., Johnson, L. R., Kenney, M. A., et al. (2023). The NEON Ecological Forecasting Challenge. Frontiers in Ecology and the Environment, 21(3), 112–113. https://doi.org/10.1002/fee.2616

9.2 Assignment

Pre-assignment set up: Complete Chapter 8 and the RShiny version of Chapter 3

  1. Complete the code-based version of Chapter 3.
  2. Copy the code from version of the template into a new R script in your GitHub repo called “forecast_code_template_mod6.R”.
  3. Add your model from “forecast_code_template.R” to “forecast_code_template_mod6.R”.
  4. Modify your “forecast_code_template.R” to include the additional sources of uncertainty
  5. Run the “forecast_code_template_mod6.R” to generate a forecast, submit the forecast, and generate the plot of the forecast.
  6. Update your model description at the top of “forecast_code_template_mod6.R” to describe the new sources of uncertainty.
  7. Commit the updated “forecast_code_template_mod6.R” to GitHub.
  8. Upload to your new plot and a link to your GitHub repository to Canvas (or other learning management system).

9.3 Module reference

Olsson F, C. Boettiger, C.C. Carey, M. Lofton and R.Q. Thomas. 2024. Can you predict the future? A tutorial for the National Ecological Observatory Network Ecological Forecasting Challenge. Journal of Open Source Education 7: 259. https://doi.org/10.21105/jose.00259