FRBNY-DSGE / DSGE-2015-Apr

Replication files for Liberty Street Economics blog post "The FRBNY DSGE Model Forecast--April 2015"
http://libertystreeteconomics.newyorkfed.org/2015/05/the-frbny-dsge-model-forecast-april-2015.html
30 stars 24 forks source link

bugs in prior density and unconstrained optimization #4

Open ikarib opened 7 years ago

ikarib commented 7 years ago

Bug 1: Rstard should be defined as (1 + Rstarn/100) bstar Proof: Rstarn was defined as 100 (rstar*pistar-1) and used in measurement equations for short-term and long-term nominal interest rates and expected FFR.

Bug 2: incorrect prior density of inverse-gamma distribution: Proof: correct PDF is given at https://en.wikipedia.org/wiki/Scaled_inverse_chi-squared_distribution

Bug 3: the mode is constrained at the upper boundary on parameter rho_sigw Proof: Unconstrained minimization algorithm such as csminwel requires rescaling of constrained parameters. The problem is that we don't know if any of the constraints will become binding at the mode. For example, parameter rho_sigw becomes binding at the upper boundary 0.99 that was imposed in original v990 code (as evidenced from output from IRIS optimizer fmincon). That caused the csminwel to slow down to a crawl since the unscaled parameter tried to go to infinity. I therefore had to increase this upper limit to 0.999 (since the mode is at 0.9945). As a result the Julia csminwel code which was running several days, now runs in 4 hours after binding constraint on rho_sigw was removed. We can avoid this problem in IRIS by using constrained minimization method such as fmincon (with active-set algorithm), which can estimate the model in 5 minutes.

You can see the fixed code in pull request #3 and my replication in IRIS at https://github.com/ikarib/FRBNY-IRIS

pearlzli commented 7 years ago

Regarding bug 2, the given prior density refers to the square root of the inverse gamma distribution. This is because we put priors on standard deviations, not variances, in our model. This is hopefully more clear in our Julia code, where we define a RootInverseGamma type and its density. The root inverse gamma density we use comes from the appendix of Arnold Zellner's book, An Introduction to Bayesian Inference in Econometrics (1971).