Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ramsey Discounting and Equity Weighting Options #49

Open
wants to merge 27 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b0cc64f
Add Ramsey discounting options for determinstic runs
lrennels Jul 12, 2021
0a242ed
Add tests
lrennels Jul 12, 2021
5dbe389
Add tests
lrennels Jul 13, 2021
2bd5842
Add notes; PAGE is failing tests
lrennels Jul 13, 2021
0d28205
Clarify language about eta parameter
lrennels Jul 13, 2021
f0ac884
Fix years on PAGE scc computation
lrennels Jul 13, 2021
2f2e416
Clean up comments and remove discount keyword from testing
lrennels Jul 14, 2021
19cb792
Use discount factors intstead of rates for Ramsey
lrennels Aug 4, 2021
74e1898
Fix bugs in Ramsey; add equity Boolen
lrennels Aug 6, 2021
e065872
Fix logic of testing
lrennels Aug 6, 2021
d6022ec
Add comments and clarification of function signatures
lrennels Aug 6, 2021
e30327e
More cleanup and testing
lrennels Aug 6, 2021
c2f74cf
First attempt to add Ramsey to mcs
lrennels Aug 7, 2021
d223a04
Finish mcs shift to ramsey discounting
lrennels Aug 9, 2021
7ed0556
Add tests; fix PAGE bug
lrennels Aug 9, 2021
7ca0f9b
Remove Manifest
lrennels Aug 10, 2021
2cef2c4
Add some temporary debuggign code and fix for zero consumption
lrennels Aug 12, 2021
12c1dc1
Add infinite flag
lrennels Aug 13, 2021
da541cc
Fix inf filtering bug
lrennels Aug 14, 2021
0b9f257
Add SCC comparison file
lrennels Aug 20, 2021
32abc35
Fix documentation
lrennels Sep 1, 2021
417b771
Merge main
lrennels Sep 21, 2022
76a0995
Remove dependency on ExcelReaders in Project toml
lrennels Sep 21, 2022
40f3099
Add p_idx to fund mcs
lrennels Sep 21, 2022
9fafc15
Merge main
lrennels Oct 31, 2022
1acdd13
Begin to add ability to set reference year for calculating SCC
lrennels Oct 31, 2022
d9ab334
Add generalization for reference year
lrennels Oct 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
output/*
.vscode
.DS_Store
*/output/*
/output/*
32 changes: 16 additions & 16 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@ uuid = "b1d80750-afbf-11e9-0666-4f25b2ea2b65"
version = "1.2.1-DEV"

[deps]
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
CSVFiles = "5d742f6a-9f54-50ce-8119-2520741973ca"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
Mimi = "e4e893b0-ee5e-52ea-8111-44b3bdec128c"
MimiDICE2010 = "4f2c5d70-42a7-11e9-1de8-c370bd984083"
MimiFUND = "b3ba11de-429f-11e9-29f7-cb478ab96e7c"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
CSVFiles = "5d742f6a-9f54-50ce-8119-2520741973ca"
Query = "1a8c2f83-1ff3-5112-b086-8aa67b057ba1"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
MimiPAGE2009 = "e25d4f70-4200-11e9-37f3-3b45f1cef54f"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Mimi = "e4e893b0-ee5e-52ea-8111-44b3bdec128c"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
XLSX = "fdbf4ff8-1666-58a4-91e7-1b58723a45e0"
MimiFUND = "b3ba11de-429f-11e9-29f7-cb478ab96e7c"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
MimiDICE2010 = "4f2c5d70-42a7-11e9-1de8-c370bd984083"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
julia = "1.4"
StatsBase = "0.33"
XLSX = "0.7.3"
MimiPAGE2009 = "3.0"
Distributions = "0.23, 0.24, 0.25"
Mimi = "1.3"
MimiFUND = "=3.8.6"
Interpolations = "0.13"
Mimi = "1.3"
MimiDICE2010 = "1.0"
MimiFUND = "=3.8.6"
MimiPAGE2009 = "3.0"
StatsBase = "0.33"
XLSX = "0.7.3"
julia = "1.6"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,18 @@ julia> using MimiIWG
The main available functions are:
- `MimiIWG.get_model(MODEL_NAME, SCENARIO_CHOICE)`

- `MimiIWG.get_marginaldamages(MODEL_NAME, SCENARIO_CHOICE, gas=:CO2, year=2020, discount=0)`
- `MimiIWG.get_marginaldamages(MODEL_NAME, SCENARIO_CHOICE, gas=:CO2, year=2020, discount=0., regional=false)`

- `MimiIWG.compute_scc(MODEL_NAME, SCENARIO_CHOICE, gas=:CO2, year=2020, discount=0.03)`
- `MimiIWG.compute_scc(MODEL_NAME, SCENARIO_CHOICE, gas=:CO2, year=2020, prtp=0.03, eta = 0., domestic=false)`

- `MimiIWG.run_scc_mcs(MODEL_NAME; gas=:CO2, trials=10000, perturbation_years=collect(2010:5:2050), discount_rates=[0.025, 0.03, 0.05])`
- `MimiIWG.run_scc_mcs(MODEL_NAME; gas=:CO2, trials=10000, perturbation_years=collect(2010:5:2050), prtp_rates=[0.025, 0.03, 0.05], eta_levels = [0.], domestic = false)`

The choices for `MODEL_NAME` are `DICE`, `FUND`, or `PAGE`.

The choices for `SCENARIO_CHOICE` are `USG1`, `USG2`, `USG3`, `USG4`, and `USG5`. For more information on these scenarios, see below.

For discount rates, the `discount` parameter in `MimiIWG.get_marginaldamages` indicates a constant discount rate, while `prtp` and `eta` in `MimiIWG.compute_scc` parameterize a Ramsey discount rating scheme (ie. a `discount` used for the former is equivalent to a `prtp` = `discount` combined with `eta` = 0. for the latter). You may optionally use the `equity_weighting` and `normalization_region` keyword arguments to indicate equity weighting preferences.

For example uses of the code, see ["examples/example.ipynb"](https://github.com/rffscghg/MimiIWG.jl/blob/master/examples/example.ipynb).

### Monte Carlo simulations
Expand All @@ -62,14 +64,18 @@ MimiIWG.run_scc_mcs(MODEL,
gas = :CO2, # specify the greenhouse gas. :CH4 and :N2O also available
trials = 10000, # the size of the Monte Carlo sample
perturbation_years = collect(2010:5:2050), # List of years for which to calculate the SCC
discount_rates = [0.025, 0.03, 0.05], # List of discount rates for which to calculate the SCC
domestic = false, # Whether to calculate domestic SCC values, in addition to calculating the global values
prtp_rates = [0.025, 0.03, 0.05], # List of pure rate of time preference rates for which to calculate the SCC
eta_levels = [0.], # List of inequity aversion levels for which to calculate the SCC
domestic = false, # Whether to calculate domestic SCC values, in addition to calculating the global values,
equity_weighting = false, # Whether to use equity weighting for calculation of the SCC
normalization_region = nothing, # Region by which to normalize for equity weighting option
output_dir = nothing, # Output directory. If unspecified, a directory with the following name will be created: "output/MODEL yyyy-mm-dd HH-MM-SS SC-$gas MC$trials"
save_trials = false, # Whether to save all of the input data sampled for each trial of the Monte Carlo Simulation. If true, values get saved to "output_dir/trials.csv"
tables = true # Whether to save a series of summary tables in the output folder; these include statistics such as percentiles and std errors of the SCC values.
drop_discontinuities = false # PAGE specific see below
save_md = false # Whether to save the global undiscounted marginal damages from each run of the simulation in a subdirectory "output/marginal_damages"
)

```
Note that the Monte Carlo Simulations are run across all five of the USG socioeconomics scenarios.

Expand Down
Binary file not shown.
Loading