This python code solves the Dynamic Integrated Climate-Economy (DICE) 2023 model of William Nordhaus. It is directly based on Nordhaus’ own code.
This version is beta. Think of it as version 0.1. Please contact huasheng.nie.phd@anderson.ucla.edu or ivo.welch@ucla.edu if you find a bug.
Installation
It is recommended to install this python dice model code in a fresh ubuntu LTS virtual machine guest. Virtual machines are freely available. (If your computer is a macos machine, we recommend UTM as the free server host.) Note that we can’t offer support or feedback unless you follow this route. (If you want to install this python code in other environments, and you know what you are doing, it should still work. However, you are on your own.)
- Extract all the dice model files:
$ tar xfz dice-2023-*.tar.gz
At this point, all the files should appear in the current directory.
- Set up the environment:
This command installs the required programs and libraries (which requires sudo access).
Verifying Functionality
All configuration parameters are defined in the file nordhaus-base.conf
. The user passes this file to the program:
$ python3 dice.py nordhaus-base.conf
This run should take about 30-60 seconds. The result will be two files: nordhaus-base_result.csv
and nordhaus-base_fig.pdf
.
Running Own Code
Copy nordhaus-base.conf
to myown.conf
, edit it to make changes, and then re-run the model with these new parameters.
There are many parameters that can be modified. For example:
- [UNpopulation]
- If set to True, it uses the United Nations population model (rise and fall). Otherwise, Nordhaus original DICE2023 statistical distribution population model is used. (This makes little difference in the optimal solution.)
- [Default_TCR_ECS]
- If True, DICE2023’s default parameters (TCR=1.8, ECS=3) are used. Otherwise, set TCR and ECS through TCR_defined and ECS_defined.
- [Log Cauchy Distribution]
- Set logmu_tcr, logmu_ecs, logstd_tcr, logstd_ecs, and logcorr for the bivariate log-Cauchy distribution.
- [LogCauchyMC]
- Determines the sample size for Monte Carlo simulations. Avoid setting this too high.
- [Default_TCR_ECS]
- Chooses between the default DICE2023 run or a customized run from the specified nordhaus-base.conf.
- [OptBaseline]
- Enables the full baseline model with optimized emission control rate and saving rate.
- [OptZeroTax]
- Enables the zero tax model with optimized saving rate and zero control rate.
Outputs
-
CSV File: Contains all the parameters and DICE optimal results, including utility and trajectories.
-
Figures: Compares baseline and zero tax scenarios, illustrating the differences and outcomes of each model.
APPENDIX
Individual File Descriptions
- [nie_welch_logcauchy.py]
- This module provides functionality for the log-Cauchy distribution, particularly for climate sensitivity parameters - Transient Climate Response (TCR) and Equilibrium Climate Sensitivity (ECS).
- [dice_nhs.py]
- Main functionalities of the code include:
2.1 Implementation of the DICE parameter class.
2.2 Optimization of the DICE model for baseline and zero tax scenarios.
2.3 Output and visualization of DICE model results.
- [dice.py]
- The main executable file that calls the above modules and executes the code.
- [nordhaus-base.conf]
- A file containing manually set parameters, which can be customized for different use cases.
Nov 17, 2023