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

9.2.1 Part 1

The first part of this assignment revisits the shiny app-based assignment in Chapter 3. The goal is to explore how the concepts of representing and partitioning uncertainty in forecasts are expressed in R code. It lays the foundation for adding uncertainty to NEON water temperature forecasts in Chapter 8. To complete the assignment:

  1. Fork repository for the assignment.
  2. Complete activities A, B, and C (through question 16) in the Rmarkdown document. You will be modifying the RMarkdown document with the answers to the questions (both text and code).
  3. Knit the Rmarkdown Rmd to HTML.
  4. Commit the RMarkdown and HTML files to GitHub

9.2.2 Part 2

  1. Copy the code from version of the template into a new R script called “forecast_code_template_mod6.R” that is placed in the Submit_forecast directory of your “NEON-forecast-challenge-workshop” GitHub repo. This is similar to the forecast_code_template.R in Chapter 8 by updating the way forecasts are generated to be more similar to how they are generated in the module6.Rmd
  2. Add your model from “forecast_code_template.R” to “forecast_code_template_mod6.R”.
  3. Modify your “forecast_code_template.R” to include the additional sources of uncertainty that are relevant to the model that is used for forecasting.
  4. Run the “forecast_code_template_mod6.R” to generate a forecast, submit the forecast, and generate the plot of the forecast.
  5. Update your model description at the top of “forecast_code_template_mod6.R” to describe the new sources of uncertainty.
  6. Commit the updated “forecast_code_template_mod6.R” to GitHub.
  7. 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