# Number of points with pareto\_k \> 0.7 increases when a subset of the data set is used

**URL:** <https://discourse.mc-stan.org/t/number-of-points-with-pareto-k-0-7-increases-when-a-subset-of-the-data-set-is-used/9108>\
**Category:** Modeling\
**Created:** [June 5, 2019, 8:43am UTC](https://discourse.mc-stan.org/t/number-of-points-with-pareto-k-0-7-increases-when-a-subset-of-the-data-set-is-used/9108 "2019-06-05T08:43:46Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Max\_Mantei](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/max_mantei/32/7912_2.png) [@Max\_Mantei](https://discourse.mc-stan.org/u/Max_Mantei)\
**Post date:** [June 13, 2019, 4:26pm UTC](https://discourse.mc-stan.org/t/number-of-points-with-pareto-k-0-7-increases-when-a-subset-of-the-data-set-is-used/9108/15 "2019-06-13T16:26:28Z")

</div>

You are not the first one to struggle with the Lognormal (I did too for a while). You might want to check out the actually good [Wiki article](https://en.wikipedia.org/wiki/Log-normal_distribution). Note, that the Lognormal has support (0,+\infty), but it’s location parameter has is \mu \in (-\infty,+\infty) – note, that this is _not_ the mean. This is working, because (loosely speaking) the location parameter “runs through” the \exp() function, which maps the input values to the positive real numbers (-\infty,+\infty) \rightarrow (0,+\infty). This means, that \mu is on the log-scale. And that it is called \mu is kinda unfortunate. Well, it does actually make sense, because the way how the log-normal is often defined (in Stan as well) is

\log(Y) \sim \text{Normal}(\mu,\sigma) \leftrightarrow Y \sim \text{LogNormal}(\mu,\sigma).

Well, these are not really equivalent, because in the first you have a change of variables (\log(Y)) and since in Bayesian estimation you are working with probability densities, you need [apply the change of variable formula](https://en.wikipedia.org/wiki/Probability_density_function#Dependent_variables_and_change_of_variables)… There is also a tiny section on this in the Stan manual.

Does this make sense?

Also, when I said that you need to take care of the model formula when applying link functions, I was a bit sloppy. I give you two examples from Simon Wood’s fantastic GAM book (Chapter 3, GLMs):

1. Suppose a disease epidemic with relatively few cases (y\_i) for now. But the rate of new cases occurring increases exponentially through time. Let \eta\_i be the expected number of cases at time t\_i, the model is \eta\_i = \gamma \exp(\delta t\_i). Using a log-link the model becomes \log(\eta\_i)=\log(\gamma) + \delta t\_i and letting \beta\_0 = \log(\gamma) and \beta\_1 = \delta, one can write: \log(\eta\_i) = \beta\_0 + \beta\_1 t\_i. Note that \beta\_0 is now on the log-scale. In R this could look like: `glm(y ~ 1 + t, family = poisson(link="log"))`.

2. The rate of caputre of prey, y\_i by a hunting animal increases with density of prey, x\_i but levels off eventually when predators catch as much as they are capable of. Let the model by \eta\_i=\dfrac{\alpha x\_i}{h + x\_i}, where \alpha is the max. capture rate and h the prey density at which the max. capture rate is halved. Using a reciprocal (i.e. inverse) link yields 1/\eta\_i = \dfrac{1}{\alpha} + \dfrac{h}{\alpha} \dfrac{1}{x\_i} = \beta\_0 + \beta\_1 \dfrac{1}{x\_i}, by letting \beta\_0=1/\alpha and \beta\_1=h/\alpha. In R this could look like this: `glm(y ~ 1 + I(1/x), family = Gamma(link="inverse"))`.

That being said, I’m not sure that this can be neatly done with your model…

---

_[View the full topic](https://discourse.mc-stan.org/t/number-of-points-with-pareto-k-0-7-increases-when-a-subset-of-the-data-set-is-used/9108)._
