Inverse gamma 1 distribution: bug?


I was recently comparing estimation results from my codes and Dynare. There is a small difference in the log posterior (kernel). I am wondering whether it is because the two parameters (nu and s) of Inverse Gamma-1 computed by Dynare are not correct for some values of mean and standard deviation.

It seems that Dynare uses the following function to compute nu and s given mean and standard deviation.


For (mean 0.75, sd 0.1), the result of

[s,nu] = inverse_gamma_specification(0.75,0.1,1)


s = 11.2136
nu = 21.5870

But the correct answer is

s = 16.2409
nu = 30.3684

The numerical method to find a root in the function does not seem to work well for (mean 0.75, sd 0.1 or smaller).

Hi, Thanks for reporting this bug (I have added it to our bug tracker We use a secant method to solve for nu. In this case, for an unknown reason, the algorithm diverge…

Best, Stéphane.