# Behavior of Marginal Model Functions

**URL:** <https://forum.mimiframework.org/t/behavior-of-marginal-model-functions/102>\
**Category:** Uncategorized\
**Created:** [November 10, 2019, 6:00pm UTC](https://forum.mimiframework.org/t/behavior-of-marginal-model-functions/102 "2019-11-10T18:00:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrankErrickson](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.mimiframework.org/frankerrickson/32/13_2.png) [@FrankErrickson](https://forum.mimiframework.org/u/FrankErrickson)\
**Post date:** [November 10, 2019, 6:00pm UTC](https://forum.mimiframework.org/t/behavior-of-marginal-model-functions/102/1 "2019-11-10T18:00:14Z")

</div>

If I use your SCC function, or if I take the marginal damages from the “marignal model” used for that SCC estimate and discount them, I get results that differ by ~ $2. In this case I’m just using what I think is the equation you use to calculate discount factors. Perhaps I’m missing something basic here, but shouldn’t these give the same results?

Here’s some replication code:

```auto
using MimiDICE2013

# DICE model years.
model_years = 2010:5:2305

# Emission pulse year and index.
year = 2020
year_index = findfirst(isequal(year), model_years)

# Last model year.
last_year = 2305

# Discounting stuff using Mimi discounting code.
eta = 0.0
prtp = 0.03
cpc = ones(60)
df = [zeros(year_index-1)..., ((cpc[year_index]/cpc[i])^eta * 1/(1+prtp)^(t-year) for (i,t) in enumerate(model_years) if year<=t<=last_year)...]

# SCC from function.
scc, marginal_model = MimiDICE2013.compute_scc_mm(year=pulse_year, last_year=2305, prtp=0.03, eta=0.0)

# Calculated marginal damages.
marginal_damages = marginal_model[:damages, :DAMAGES]

# SCC from these marginal damages.
other_scc = sum(marginal_damages .* df) * 5 * 1e12 

```

---

<div class="post-metadata">

**Author:** ![ckingdon95](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.mimiframework.org/ckingdon95/32/15_2.png) [@ckingdon95](https://forum.mimiframework.org/u/ckingdon95)\
**Post date:** [November 15, 2019, 2:10pm UTC](https://forum.mimiframework.org/t/behavior-of-marginal-model-functions/102/2 "2019-11-15T14:10:44Z")

</div>

Hi Frank, I think the difference is that the `compute_scc_mm` uses the difference in _consumption_, not just the damages variable. If you try your code and change the second to last line to:

```auto
marginal_damages = marginal_model[:neteconomy, :C]

```

Do you get the same SCC answer?
