Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed bugs in prior density and unconstrained optimization #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ikarib
Copy link
Contributor

@ikarib ikarib commented Feb 3, 2017

Bugs 2 and 3 are two remaining bugs from my previous pull request.

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: Labor can not be normalized to one (as in SW) since it violates FOC for labor in the steady state.
Proof: This was mentioned in appendix (page 58) but not implemented in the code.

Bug 3: missing term z_{t-1} and incorrect coefficient for term z_t in Phillips curve for wages
Proof: If we take wage Phillips curve (equation 13 in SW) and replace pi_t with pi_t+z_t then we don't get the same equation as 8.106.

Bug 4: incorrect prior density of inverse-gamma distribution, the standard deviation parameter should not be squared since it is already transformed from real line to positive numbers
Proof: correct PDF is given at https://en.wikipedia.org/wiki/Scaled_inverse_chi-squared_distribution
where parameters are: tau=a, nu=b and x=para(i) (not para(i)^2)

Bug 5: 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.

Bug 1: Labor can not be normalized to one (as in SW) since it violates
FOC for labor in steady state.
Proof: This was mentioned in appendix (page 58) but not implemented in
the code.

Bug 2: missing term z_{t-1} and incorrect coefficient for term z_t in
Phillips curve for wages
Proof: If we take wage Phillips curve (equation 13 in SW) and replace
pi_t with pi_t+z_t then we don't get the same equation as 8.106.
fixed the squaring of transformed parameter in inverse gamma prior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant