Lab 3: Addressing Uncertainty in Multisector Dynamics Tutorials
Overview
Today we’re going to get comfortable running code for uncertainty analysis and apply relevant methods to our decision analysis problem.
Today’s objectives:
- Reproduce the MSD UC/UQ book Python environment locally
- Choose a tutorial that resonates with you and run its code
- Demonstrate your conceptual understanding of the analysis you ran and its interpretation
- (Optional) Apply the workflow from the tutorial to your project data
Lab Workflow
GitHub Repository Setup
We are interested in running the MSD e-book tutorials locally, so we will adapt the contribution instructions for this purpose.
- Fork the MSD Uncertainty e-book then clone it locally
- Create a
conda
ormamba
environment with a compatible Python version for the e-book. You can check the compatible Python versions here. I created an environmentucuq_book
with python version 3.12 and was able to run the notebooks locally. - Make sure your environment is activated and
cd
to your local repository. Runpip install .
to install all the packages you need to run the tutorials. I also installedipykernel
to set up the environment as a kernel and run the code in VSCode.
Choose the tutorial to run and adapt for your project data
Take a look at the online tutorials and identify the uncertainty analyses that you can envision running with your project data. Pick the one that you feel is the most relevant for your decision analysis goals and run this notebook locally. If you feel that none of these tutorials map well to your goals, let’s chat ;)
Run the uncertainty analysis you chose on your project data
This is optional, but recommended. It is likely easier for you to run the uncertainty analysis in the directory where you work on your decision analysis. Figure out which packages to install into your project environment to run the uncertainty analysis you tried out in the previous step. Apply this uncertainty analysis with your decision analysis model. You do not have to successfully execute the uncertainty analysis to receive the full grade on this lab, but I recommend you try because it is more synergistic with your project than running code for a generic tutorial.
Explain the uncertainty analysis you ran and its interpretation
For your lab report, please submit a concise write-up on the uncertainty analysis you ran and its interpretation for the underlying data. I recommend calibrating your writing content and tone for manuscript style (e.g., see the “Sensitivity Analysis” section of the Methods in this paper and also see how the authors interpret the results of this procedure in the Results subsection “Uncertainties that drive the variance of projected damages”). I expect the following qualities in your text:
- a clear English explanation of the analysis plan
- this includes emphasizing what question(s) the analysis addresses and why it is appropriate for the problem at hand
- justification of the chosen sampling plan and sample size
- specific reference to the analysis results
- e.g., include a figure (or more than one) in your report
- thoughtful interpretation
- this includes highlighting key assumptions
- accurate references
- you might only cite the MSD book and references within it, but you might also find it helpful to look beyond those
If you ran the analysis on your project data, you only have to explain the analysis and interpretation for that example.
Submit your lab report
For the online training, you can send me the pdf of your lab report. I do not need to see any code, but you are welcome to share your repositories with me if you would like me to take a look. I recommend wrapping up your notebook and lab report into a GitHub repository so that you can bolster your online portfolio, but I understand that this is time-intensive so it is not required.