I need to run millions of model simulations, so I’ve been messing around with different ways of getting this to be fast using Mimi. One issue I’m having trouble with is whether the internal Mimi Monte Carlo set-up is faster/slower than a Monte Carlo that I code up from scratch.

Here’s the basic scenario: I run DICE with millions of different climate sensitivity values. For each run, I want to return the sum of discounted climate damages. My Monte Carlo from scratch looks something like this:

```
for i = 1:1000000
update_param!(m, :t2xco2, ECS_sample[i])
run(m)
npv_damages[i] = sum(df .* m[:neteconomy, :DAMAGES])
end
```

where …

**m** = Mimi version of DICE,

**df** = discount factors,

**npv_damages** = an empty array to store my results,

**ECS_sample** = a vector of climate sensitivity values.

When I use the internal Mimi approach for a Monte Carlo, I ended up with a result that had type `Array{Dict{Tuple,DataFrames.DataFrame},1}`

. I then had to extract my results from that to be able to carry out some calculations, but it was in a “melted form”, so I next needed to reshape the annual damages so they were isolated by the individual Monte Carlo simulations…and then I could discount and sum them up. Ultimately there seemed to be so many steps to sort out my results that I gave up.

So my basic question is (1) Is there an easy, quick way to do a Monte Carlo in Mimi and then modify the results without all of the reshaping steps (e.g. I take the mean of damages for each simulation). A related question that I couldn’t figure out is (2) how do I match the uncertain parameters used for an individual simulation to the actual results in the Mimi Monte Carlo?