Closed giorgi-tsu closed 2 years ago
@giorgi-tsu Thanks for reporting the issue. I'm looking into it and getting back to you as soon as possible.
@giorgi-tsu Thanks for reporting the issue. I'm looking into it and getting back to you as soon as possible.
Thank you very much @MichelJuillard for replying.
I continued testing and found out how to run it successfully on my machine which runs the following version of Windows:
Edition Windows 10 Pro Version 21H1 Installed on 6/4/2021 OS build 19043.1526 Experience Windows Feature Experience Pack 120.2212.4170.0
So, the repo Dynare.jl has definitely no problem at least regarding with running the test example1.mod file (sorry for taking your time with "false" alarm above).
What I found out is the following:
The precondition to successfully run context = @dynare "./test/models/example1/example1.mod";
is to have Dynare.jl project activated by typing activate .
in the package mode when the pwd is set to ./Dynare.jl. If this precondition is met then the command runs perfectly. See the log of the Julia REPL below:
(@v1.7) pkg> activate .
Activating project at `C:\Users\giorg\documents\Julia\Dynare\Dynare.jl`
(Dynare) pkg> using Dynare
ERROR: `using` is not a recognized command. Type ? for help with available commands
julia> using Dynare
[ Info: Precompiling Dynare [5203de40-99df-439e-afbc-014de65cb9ef]
julia> context = @dynare "./test/models/example1/example1.mod";
[ Info: 2022-02-16T12:21:59.038: Starting @dynare ./test/models/example1/example1.mod
["example1.mod", "language=julia", "json=compute"]
Starting preprocessing of the model file ...
Found 6 equation(s).
Evaluating expressions...done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 1).
JSON written after Computing step.
Preprocessing completed.
[ Info: 2022-02-16T12:21:59.978: End of preprocessing
[ Info: 2022-02-16T12:23:55.974: Start parse_statements!
Coefficients of approximate solution function
──────┬────────────────────────────────────────────────
│ y_t c_t k_t a_t h_t b_t
───────────────────────────────────────────────────────
ϕ(k) │ 0.0054 0.0385 0.9418 -0.0 -0.0125 -0.0
ϕ(a) │ 1.8367 0.4246 1.4191 0.95 0.3417 0.025
ϕ(b) │ 0.8371 -0.3187 1.4191 0.025 0.3417 0.95
e_t │ 1.9115 0.4561 1.4554 1.0 0.3505 -0.0
u_t │ 0.8308 -0.3475 1.4554 0.0 0.3505 1.0
──────┴────────────────────────────────────────────────
Note: ϕ(x) = x_{t-1} - steady_state(x)
[ Info: 2022-02-16T12:23:59.369: End parse_statements!
[ Info: 2022-02-16T12:23:59.371: End parser
Once the Dynare.jl is activated and the REPL shows (Dynare) pkg>
then one can run any .mod file in any directory by cd-ing to that directory and following the instructional command context = @dynare "./test/models/example1/example1.mod";
. I tried this to other examples like example2 and it works. Below is the output from the execution of example2.mod:
(Dynare) pkg>
julia> cd("C:/Users/giorg/documents/Julia/Dynare/Example2_test")
julia> pwd()
"C:\\Users\\giorg\\documents\\Julia\\Dynare\\Example2_test"
julia> context = @dynare "./example2.mod";
[ Info: 2022-02-16T13:32:15.122: Starting @dynare ./example2.mod
["example2.mod", "language=julia", "json=compute"]
Starting preprocessing of the model file ...
Substitution of endo leads >= 2: added 1 auxiliary variables and equations.
Found 7 equation(s).
Evaluating expressions...done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 1).
JSON written after Computing step.
Preprocessing completed.
[ Info: 2022-02-16T13:32:15.194: End of preprocessing
[ Info: 2022-02-16T13:32:22.853: Start parse_statements!
Coefficients of approximate solution function
──────┬────────────────────────────────────────────────────────────────────
│ y_t c_t k_t a_t h_t b_t AUX_ENDO_LEAD_43_t
───────────────────────────────────────────────────────────────────────────
ϕ(c) │ 0.0 0.0 0.0 0.0 0.0 -0.0 13.9319
ϕ(k) │ 0.0181 0.0332 0.9599 -0.0 -0.0072 0.0 0.5283
ϕ(a) │ 1.7619 0.4559 1.313 0.95 0.3102 0.025 -6.1021
ϕ(b) │ 0.4844 -0.1712 0.9189 0.025 0.193 0.95 3.1379
e_t │ 1.8425 0.4849 1.3575 1.0 0.3214 -0.0 -6.2044
u_t │ 0.4615 -0.193 0.9316 -0.0 0.1947 1.0 -8.3185
──────┴────────────────────────────────────────────────────────────────────
Note: ϕ(x) = x_{t-1} - steady_state(x)
[ Info: 2022-02-16T13:32:23.394: End parse_statements!
[ Info: 2022-02-16T13:32:23.395: End parser
(Dynare) pkg>
I hope this issue helps others who have been using MATLAB for Dynare but are new to Julia and want to quickly run their first dynare model file.
Thanks Giorgi but there is indeed an issue in the Dynare package. You shouldn't have to activate the Dynare project to make it run. I have found the source of the problem and working on a fix
@giorgi-tsu the issue should be solved in the new version v.0.2.1 of the package. Now Dynare should run in any project to which Dynare.jl has been added
I decided to move from MATLAB to Julia. In order to get up and running with Dynare/Julia I cloned this repo to my local folder (the address shown below), then I cd-ed to that folder and followed the instructions exactly as written in README.md, however, I ran into several errors. Having thought I have had some problems in general registry and packages, I deleteed the entire July installation and reinstalled clean version of it. The script below shows my Julia REPL for the first time after installation was complete. Despite this, it still runs into the same error when running example1 test model in this repo. Below I copied the entire output from my REPL (note that I have not installed any other packages yet. This was clean Julia package). I am not proficient enough with Julia (strated getting to know with it only a couple of days ago) to debug this error message and since I have clean install of Julia and I folowed the instructions in README.md file exactly I suspect there could be a problem with the repo itself.