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

Declaration order of variables and equations #78

Open
rmauad opened this issue Dec 7, 2023 · 3 comments
Open

Declaration order of variables and equations #78

rmauad opened this issue Dec 7, 2023 · 3 comments

Comments

@rmauad
Copy link

rmauad commented Dec 7, 2023

Dear Professor Dennis,

I work at the Research Department of the Central Bank of Brazil, and our team has been using the SolveDSGE package for Julia. I am contacting you to confirm some findings about the package.

Using the attached example model (“test_kf.txt”), we found that the declaration of variables, shocks, and equations must follow a specific pattern to ensure the order of the coefficients in the solution matrices H and K are consistent. In the attached file “Declaration order of variables and equations.docx”, I describe this pattern which depends on the endogenous or exogenous nature of the variables. In the example model, we have two exogenous variables me_X and Y, and one endogenous: XX – which depends on Y.

By breaking each of the steps described in this file, the order of the coefficients in the solution matrix H becomes inconsistent with those in matrix K. Please see the attached “Solution matrices.docx” file.

Could you please confirm if our understanding is correct? If so, may I suggest that you include a “declaration order” section in the package manual?

Thank you in advance.
Best regards,
Roberto Baltieri Mauad
[Declaration order of variables and equations.docx]
(https://github.com/RJDennis/SolveDSGE.jl/files/13599985/Declaration.order.of.variables.and.equations.docx)
Solution matrices.docx
Archive.zip

@RJDennis
Copy link
Owner

Hi Roberto,

I have received and read your comment, but I haven't had time to look into it. I believe I know what you are referring to, however, but I'll wait until I have a chance to look into it before I respond.

Richard

@rmauad
Copy link
Author

rmauad commented Dec 13, 2023

No problem, please take your time. Thank you!

@paulbousquet
Copy link

I just encountered a similar issue -- an error was thrown that the shocks weren't AR(1). When I printed the relevant line of code in solution_functions.jl, the matrix being checked to be a diagonal was [0 1;1 0]. My shocks were listed as e_r, e_a in the shocks block, but in the equations block the equation for A (containing e_a) was entered first. Once I switched them, this was no longer a problem.

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

No branches or pull requests

3 participants