inverse gamma 1 distribution: bug?
Posted: Thu Nov 10, 2011 4:25 am
Hi,
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.
\dynare-4.2.2\matlab\distributions\inverse_gamma_specification.m
For (mean 0.75, sd 0.1), the result of
[s,nu] = inverse_gamma_specification(0.75,0.1,1)
is
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).
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.
\dynare-4.2.2\matlab\distributions\inverse_gamma_specification.m
For (mean 0.75, sd 0.1), the result of
[s,nu] = inverse_gamma_specification(0.75,0.1,1)
is
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).