# Hierarchical Gompertz model

**URL:** https://discourse.mc-stan.org/t/hierarchical-gompertz-model/13724
**Category:** brms
**Tags:** covid-19
**Created:** [March 17, 2020, 11:05pm UTC](https://discourse.mc-stan.org/t/hierarchical-gompertz-model/13724 "2020-03-17T23:05:31Z")
**Posts on this page:** 1
**Showing post:** 79

<div class="post-metadata">

### Author: ![jroon](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@jroon](https://discourse.mc-stan.org/u/jroon)
#### Post date: [April 5, 2020, 4:22pm UTC](https://discourse.mc-stan.org/t/hierarchical-gompertz-model/13724/79 "2020-04-05T16:22:20Z")

</div>

Ok just to check my thinking here before I model this:  
Given my gompertz function, where t = time in days:

\\Y = f(t) = Ae^{-exp(-k( t - d ))}

I said let:

\\y\_{max} = Ae^{-exp(-k( t\_{max} - d ))}

Applied some algebra and got:

\\f(t) = y\_{max} \cdot e^{(exp(-k(t\_{max} - d) - exp(-k(t - d) ))}

where y\_max, t and t\_max are all taken from data meaning I now have a 2 parameter model.

Am I in thinking along the right lines here? Presumably then after I would fit this I then calculate A in the generated data section using the middle equation here ?

@mevers - I hope you don’t mind me part-invading your thread!

Edit: test for single country fits - i.e. no hierarchy look good so far! Will update as I progress!  
Edit2: Algebra incorrect deriving last equation - fixed now.

---

_[View the full topic](https://discourse.mc-stan.org/t/hierarchical-gompertz-model/13724)._
