inverse gamma 1 distribution: bug?

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

inverse gamma 1 distribution: bug?

Postby woongp » 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).
woongp
 
Posts: 1
Joined: Thu Nov 10, 2011 4:10 am

Re: inverse gamma 1 distribution: bug?

Postby StephaneAdjemian » Thu Nov 10, 2011 10:01 am

Hi, Thanks for reporting this bug (I have added it to our bug tracker www.dynare.org/trac/225). We use a secant method to solve for nu. In this case, for an unknown reason, the algorithm diverge...

Best, Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 13 guests