IRIS-Solutions-Team / IRIS-Toolbox

[IrisToolbox] for Macroeconomic Modeling
Other
90 stars 41 forks source link

Empty domain for inverse gamma distribution #265

Closed Deamonell closed 4 years ago

Deamonell commented 4 years ago

Dear Jaromir,

I have a problem with IRIS version from 20200303 and so on. I'm trying to estimate a simple QPM model with Bayesian estimation of coefficients. The "estimate" function gives an error: "Index exceeds the number of array elements (0)".

I've found out that the problem appears since 20200303 and comes from adding a prior on standard deviation (it works with priors on coefficients). The main difference in these priors is that the latter has an inverse gamma prior distribution (while former have beta distribution) and I've found that in the previous version of IRIS it has lower bound and upper bound 0 and inf respectively. However, in 20200303 it has a domain instead. And if in the case of beta distribution it is between 0 and 1, in the case of inverse gamma it is [].

A simple fix for me that actually works is to change the domain by hands, but I'm not quite sure that I won't break something inside the other part of the code with this action. Maybe you can give me advice on whether my solution is ok and fix the issue in the further version of IRIS.

Thank you for your attention! Dmytro

jaromir-benes commented 4 years ago

Hi Dmytro

the domain for the inv gamma distribution was fixed recently, and it is now set to [0, Inf] in the latest release, see e.g.

https://github.com/IRIS-Solutions-Team/IRIS-Toolbox/blob/Release-20200626/Statistics/+distribution/InvGamma.m

Best Jaromir

On Fri, Jul 24, 2020 at 2:57 PM Dmytro Krukovets notifications@github.com wrote:

Dear Jaromir,

I have a problem with IRIS version from 20200303 and so on. I'm trying to estimate a simple QPM model with Bayesian estimation of coefficients. The "estimate" function gives an error: "Index exceeds the number of array elements (0)".

I've found out that the problem appears since 20200303 and comes from adding a prior on standard deviation (it works with priors on coefficients). The main difference in these priors is that the latter has an inverse gamma prior distribution (while former have beta distribution) and I've found that in the previous version of IRIS it has lower bound and upper bound 0 and inf respectively. However, in 20200303 it has a domain instead. And if in the case of beta distribution it is between 0 and 1, in the case of inverse gamma it is [].

A simple fix for me that actually works is to change the domain by hands, but I'm not quite sure that I won't break something inside the other part of the code with this action. Maybe you can give me advice on whether my solution is ok and fix the issue in the further version of IRIS.

Thank you for your attention! Dmytro

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/IRIS-Solutions-Team/IRIS-Toolbox/issues/265, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCVKKU4WMDPOHHB4ZCR4CDR5GALHANCNFSM4PGWCBFA .

Deamonell commented 4 years ago

Oh, ye, I somehow missed the latest release and used 20200526, where the bug still exists. Sorry for my inattentiveness. Thank you for such a fast answer!

jaromir-benes commented 4 years ago

No worries. Best, Jaromir

On Fri, Jul 24, 2020 at 3:34 PM Dmytro Krukovets notifications@github.com wrote:

Oh, ye, I somehow missed the latest release and used 20200526, where the bug still exists. Sorry for my inattentiveness. Thank you for such a fast answer!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/IRIS-Solutions-Team/IRIS-Toolbox/issues/265#issuecomment-663541057, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCVKKXS4XT3JUQT5SMEJ4DR5GEVTANCNFSM4PGWCBFA .