Mimi Framework

Question: Variable discount rates

Is it possible, using the Mimi framework, perhaps creating a DICE model if not just modifying it, to discount yearly damages with different rates, such as shown below?

yearly damages: d_1 d_2 … d_n
variable rates: r_1 r_2 … r_n


On a high level yes this should certainly be possible, but the way to go about such a modification will depend on which model you are using and how you are calculating (marginal?) damages. In most cases the discounting and aggregation of damages is done using helper functions that process the outputs of a model, so this is likely not a case for set_param! or update_param! but instead for modification of an existing helper function (ie. MimiIWG.get_marginal_damages) or creation of a new one. If you let us know your more particular case we might be able to direct you to the proper Mimi machinery to reach your goals!

@ckingdon95 pinging you here


Lisa – Yes, discounting marginal damages. MimiIWG.get_marginal damages sounds like in the right direction. I will provide more details as to what I’m attempting in near future.

Meanwhile, where can I find more info on MimiIWG.get_marginal damages?
Thanks! Gui

Gui - I have a check-in with our resident MimiIWG expert tomorrow to make sure we merge the other fixes you so helpfully pointed out in your other post, and will double check the best path forward with her and then get back to you asap! - Lisa

Hi @lrennels and @glarange. Just to point out a few ways to get at this that Cora (in her awesomeness) has explored:

  1. In the branch mcs-md-option (link) one can use the keyword save_md=TRUE to store the undiscounted stream of marginal damages and subsequently use any discounting path they would like.

  2. Alternatively, if you are interested in a Ramsey-type framework, in the ramsey branch (link) one can set the near-term discount_rates, then choose parameters prtp and eta to discount damages according to the growth rate g from the EMF scenarios.

I’ve been using (1) as it is convenient and allows various post-estimation decisions to be made without re-running the model.

@parthum thank you so much for pointing that out! I was similarly going to suggest something like (1) except with the deterministic function listed in the README

damages = MimiIWG.get_marginaldamages(MODEL_NAME, SCENARIO_CHOICE, gas=:CO2, year=2020, discount=0)

so one could just pass along a discount_rate keyword argument of 0, which I believe is the default, return the stream of (marginal) damages, and then discount them as you wish.

@parthum would you say the advantage of your (1) over this is mainly that your option employs Monte Carlo and mine is the deterministic case?

Backing up a step to documentation and branches …

  • all of the existing documentation for MimiIWG seems to be in it’s Github readme (here). If you want to dig a bit deeper into what the various functions look like, you can browse the files from the Github browser, or git clone the package onto your local machine and take a look at things.

  • The experimental branches @parthum lists above are certainly an option if you want to beta test some of the forefront work, and if you want to do that but are fairly new to Julia and/or Github we’re happy to help move you through the various steps. I’m going to put (1) into the main codebase now though so you don’t need to use a branch for that, just give it an hour or so and I’ll ping ya’ll here

Actually, you bring up a good point. I experimented with using a discount=0 but found it introduces some other issues in PAGE (but seems to not be an issue with DICE/FUND) that I haven’t quite pinned down yet. Something with the lower discount rates (0 through 0.015, and it goes away above 0.015) where the resulting SC in 0%-50% of MC runs gets caught on $0. I think it has something to do with the shape of the PAGE damage function (go figure) but it’s been on my to-do list for months and I haven’t dug into it yet. Thus, the save_md option provided the benefit of ignoring that issue for now, but also the benefit of only running the model once and handling discounting however afterwards.

Oh interesting, you mean you experimented with discount = 0 in the MimiIWG.get_marginaldamages function, or in the MimiIWG.run_scc_mcs function?

You know what @parthum it looks like that branch was already approved by David, so I’m going to merge it into master for us and tag a new version of MimiIWG does that sound good? That way you and @glarange can use it without being on a branch and just using the default version of MimiIWG pulled in with add MimiIWG.

So @glarange I think to summarize there are two good options for now.

Before you employ them wait an hour or two for me to tag things and then call

pkg> up

in your environment, after which

pkg> st

should show that you have Mimi v1.2.1 and MimiIWG v 1.0.2

At this point your issues from your previous post in the forum here will be resolved, and you’ll have the ability to do one of the two following things:

  1. To use the deterministic version of the models, you can use the get_marginaldamages function to get the undercounted marginal damages vector and do with them what you want afterwards, or wrap this in a function etc.
using MimiIWG
damages = get_marginaldamages(MODEL_NAME, SCENARIO_CHOICE, gas=:CO2, year=2020, discount=0)
  1. To use the Monte Carlo version of the models, you can set the save_md flag to TRUE in the run_scc_mcs function with full signature
        gas::Union{Symbol, Nothing} = nothing,
        trials::Int = 10000,
        perturbation_years::Vector{Int} = _default_perturbation_years,
        discount_rates::Vector{Float64} = _default_discount_rates, 
        domestic::Bool = false,
        output_dir::String = nothing, 
        save_trials::Bool = false,
        save_md::Bool = false,
        tables::Bool = true)

for which the function signature states "If save_md equals true, then global undiscounted marginal damages from each run of the simulation will be saved in a subdirectory “output/marginal_damages”. You can then use those to do whatever you want for discounting.

  1. Alternatively, if you are interested in a Ramsey-type framework, in the ramsey branch (link) one can set the near-term discount_rates , then choose parameters prtp and eta to discount damages according to the growth rate g from the EMF scenarios. For now this is an experimental branch so probably less dependable, but sounds like some people are using it!

@parthum look right?

1 Like

That’s funny, I’m getting a UndefVarError: get_marginaldamages not defined…I did up

Oh @glarange I apologize, you’re right the function get_marginaldamages is not exported by MimiIWG so you will need to use the prefix and call


Note that if you use it frequently and don’t want to have to use the prefix you can use this at the top of your file:

import MimiIWG: get_marginaldamages

let me know if that helps!