0
$\begingroup$

I have a function in R which for a given mean $\mu$ and variance $\sigma^2$, spits out the parameters for the shape, $\alpha$, and rate, $\beta$ of the inverse gamma distribution with that mean and variance.

When setting the mean fixed at $\mu=1$, I noticed that increasing the variance from say 10 to 100, has almost no visual effect on the inverse gamma produced (both plots look identical to the figure below). Furthermore, when I sample from the corresponding distributions, the values don't seem to have a variance of higher than around 1 or 2.

mu=1, var=10

// mu=1, var=10 (alpha=2.1, beta=1.1)
> rinvgamma(50,2.1,1.1)
[1] 0.9211008 0.4302407 0.5478425 0.5462700 0.3628111 1.1686150 1.0768032 1.2512244 1.7006653 0.7279801 0.5836686
[12] 0.5233413 0.3448369 0.3536895 0.8559441 0.3650069 0.5783526 0.5317600 0.8353258 0.5587801 0.4564186 1.0995836
[23] 0.3449476 0.5421546 0.1790850 7.3857559 0.6131200 0.6986830 0.2800351 0.5196334 0.3979346 0.4807825 0.3273610
[34] 1.4138987 0.9715384 0.4951919 1.6518877 0.6431032 0.2710467 0.7001043 0.2214802 0.2868089 0.3429655 0.6041847
[45] 0.2402038 0.3867785 0.2216013 0.9520140 0.5259651 0.5929160

// mu = 1, var=1000 (alpha=2.001, beta=1.001)
> rinvgamma(50,2.001,1.001)
[1] 0.6629496 2.8095275 0.4344837 0.5361150 0.5480011 0.8444600 0.4915654 1.0122025 0.4696304 0.9146489 0.5594634
[12] 0.2602492 0.6842792 0.6851688 0.4322968 3.0454766 0.2657547 0.2271760 0.7609194 0.1481709 0.9178390 0.3807237
[23] 0.7069672 1.3271837 0.4251466 1.1065251 0.5227289 0.6202342 1.6205382 1.1839423 0.6605649 0.9626064 0.9334211
[34] 0.6991242 0.7422693 0.2975816 1.0126841 0.4243968 0.6060229 0.3395812 2.5289663 4.1525575 0.8321886 1.4190376
[45] 0.2293600 0.3870373 0.7642754 0.3934958 0.7532922 0.6021346

The $\alpha$ and $\beta$ values produced from the function ($\alpha=2.1 \ , \beta=1.1$ and $\alpha=2.001 \ , \beta=1.001$) seem to give the correct $\mu$ and $\sigma^2$ according to the mean-variance equations (see Wikipedia page here) so I'm puzzled why the distributions seem very similar.

Interestingly, if I increase the mean to $\mu=100$, the same effect is observed, but for larger variances (i.e. distributions with $\mu=100$ and $\sigma^2=1000$ vs. $\sigma^2=2000$ appear the same) - as if it's parameter combinations with a large relative difference between mean and variance values that are causing the issue.

Can anyone explain why I'm observing this effect?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.