# \[ANN\] Dynare.jl is now ready for testing

**URL:** <https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177>\
**Category:** Finance and Economics\
**Tags:** announcement, dynare\
**Created:** [December 30, 2023, 6:58am UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177 "2023-12-30T06:58:36Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![MichelJuillard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/micheljuillard/32/10555_2.png) [@MichelJuillard](https://discourse.julialang.org/u/MichelJuillard)\
**Post date:** [December 30, 2023, 6:58am UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/1 "2023-12-30T06:58:36Z")

</div>

Dynare.jl ([GitHub - DynareJulia/Dynare.jl: A Julia rewrite of Dynare: solving, simulating and estimating DSGE models.](https://github.com/DynareJulia/Dynare.jl)), a Julia rewriting of Dynare,  
is now ready for testing by users. Dynare is a software for solving,  
simulating and estimating Dynamic Stochastic General Equilibrium  
(DSGE) models widely used in macroeconomics.

The following features are implemented: steady state, local  
approximation of the solution at 1st and 2nd order,  
perfect foresight simulations, forecasting, optimal policy.

Documentation is available at [https://DynareJulia.github.io/Dynare.jl](https://DynareJulia.github.io/Dynare.jl)

Thank you for reporting any error, question or desired additional feature.

---

<div class="post-metadata">

**Author:** ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Post date:** [December 30, 2023, 1:16pm UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/2 "2023-12-30T13:16:34Z")

</div>

Nice package ! Considering the post about the “1.5 language” and the original Matlab version of dynare, I was wondering about your opinion on this Matlab to Julia reimplementation 🙂

---

<div class="post-metadata">

**Author:** ![mcreel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcreel/32/30088_2.png) [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Post date:** [May 21, 2024, 10:35am UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/3 "2024-05-21T10:35:45Z")

</div>

Thanks very much for this project, I am looking forward to using it.

With the current version (0.9.11), I can run the simple RBC estimation example from [Estimation problem in Julia - Dynare Julia - Dynare Forum](https://forum.dynare.org/t/estimation-problem-in-julia/25412) without errors, but I can’t find the estimation results anywhere. I looked inside the context structure, as well as in the subdirectories that are created. Is this expected with 0.9.11?

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/micheljuillard/32/10555_2.png) [@MichelJuillard](https://discourse.julialang.org/u/MichelJuillard)\
**Post date:** [May 21, 2024, 12:11pm UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/4 "2024-05-21T12:11:43Z")

</div>

Dear Michael,

thank you for reporting the problem. There is obviously something broken in v0.9.11 with estimation. I will release a correction soon.

Note the error message at the end of the run:

```julia
ArgumentError("matrix contains Infs or NaNs")

```

Best

Michel

---

<div class="post-metadata">

**Author:** ![mcreel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcreel/32/30088_2.png) [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Post date:** [May 21, 2024, 12:29pm UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/5 "2024-05-21T12:29:43Z")

</div>

OK, thanks. I will try to test various things in the future.

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/micheljuillard/32/10555_2.png) [@MichelJuillard](https://discourse.julialang.org/u/MichelJuillard)\
**Post date:** [May 25, 2024, 12:05pm UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/6 "2024-05-25T12:05:08Z")

</div>

Dear @mcreel ,

I just released Dynare v0.9.12 that should solve the problems with the estimation code.  
Just update your environment:

```julia
] update

```

You may have to restart Julia.  
I modify the `. mod` file so that you see the first order approximation results  
See [DynareJulia estimation example used in https://forum.dynare.org/t/estimation-problem-in-julia/25412 and https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/4 · GitHub](https://gist.github.com/MichelJuillard/ff1cf3601e2f7c34d743f7e47aa79e03)

---

<div class="post-metadata">

**Author:** ![mcreel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcreel/32/30088_2.png) [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Post date:** [May 25, 2024, 4:49pm UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/7 "2024-05-25T16:49:27Z")

</div>

Hi Michel,  
Thanks, it seems to be working well now! Inside context.results, I find

```julia
estimation: Dynare.EstimationResults([0.9208808863932328, 0.04441817638943685], [2.454376213054909, -3.114106515175857], [0.03408840700653537, 0.011260134441262335], [0.4220899442337999, 0.22912707304878288], [0.0011620194922432098 -0.00036399187020596423; -0.00036399187020596423 0.00012679062763530226], [0.17815992102329234 -0.09061689673115145; -0.09061689673115145 0.052499215603902284], 0)

```

which seems to be the estimation output. I don’t know quite how to interpret it, but the estimation seems to work. Am I supposed to see a nice table of estimated coefficients, standard devs., etc., as in Dynare on Octave? That is not appearing.

Next week, I will try MCMC, etc…

Thanks!

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/micheljuillard/32/10555_2.png) [@MichelJuillard](https://discourse.julialang.org/u/MichelJuillard)\
**Post date:** [May 25, 2024, 5:24pm UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/8 "2024-05-25T17:24:56Z")

</div>

That is very strange. I get the following output. The estimation results are at the end of the log:

```julia
julia> context = @dynare "RBCmj1";
Dynare version: 0.9.12
2024-05-25T19:22:41.091: Starting @dynare RBCmj1
["RBCmj1.mod", "language=julia", "json=compute"]
Dynare preprocessor version: 6.4.0+0
Starting preprocessing of the model file ...
Found 9 equation(s).
Evaluating expressions...
Computing static model derivatives (order 1).
Normalizing the static model...
Finding the optimal block decomposition of the static model...
3 block(s) found:
  2 recursive block(s) and 1 simultaneous block(s).
  the largest simultaneous block has 7 equation(s)
                                 and 5 feedback variable(s).
Computing dynamic model derivatives (order 1).
Normalizing the dynamic model...
Finding the optimal block decomposition of the dynamic model...
3 block(s) found:
  2 recursive block(s) and 1 simultaneous block(s).
  the largest simultaneous block has 7 equation(s)
                                 and 6 feedback variable(s).
JSON written after Computing step.
Preprocessing completed.

2024-05-25T19:22:41.121: End of preprocessing
2024-05-25T19:22:41.152: Start parse_statements!
  Steady state

───────┬─────────
   Y │ 1.21132
     C │ 0.9094
     K │ 12.0783
     L │ 0.3511
     A │ 1.0
     R │ 0.0351
     W │ 2.2423
     I │ 0.302
 OBS_C │ 0.0
───────┴─────────

  Coefficients of approximate solution function (reduced form)

─────────┬────────────────────────────────────────────────────────────────────────────
         │ Y_t C_t K_t L_t A_t R_t W_t I_t OBS_C_t
──────────────────────────────────────────────────────────────────────────────────────
    ϕ(C) │ -0.0 -0.0 0.0 0.0 0.0 -0.0 0.0 -0.0 -1.0997
    ϕ(K) │ 0.0188 0.0431 0.9507 -0.0073 0.0 -0.0024 0.0812 -0.0243 0.0474
    ϕ(A) │ 1.6994 0.2401 1.4593 0.2595 0.9226 0.0492 1.4888 1.4593 0.264
 eps_A_t │ 1.842 0.2602 1.5818 0.2813 1.0 0.0534 1.6137 1.5818 0.2862
─────────┴────────────────────────────────────────────────────────────────────────────

  Note: ϕ(x) = x_{t-1} - steady_state(x)

  THEORETICAL MOMENTS

──────────┬──────────────────────────────
 VARIABLE │ MEAN STD. DEV. VARIANCE
─────────────────────────────────────────
        Y │ 1.2113 0.2381 0.0567
        C │ 0.9094 0.1181 0.014
        K │ 12.0783 2.2739 5.1705
        L │ 0.3511 0.0259 0.0007
        A │ 1.0 0.1141 0.013
        R │ 0.0351 0.0052 0.0
        W │ 2.2423 0.3294 0.1085
        I │ 0.302 0.154 0.0237
    OBS_C │ 0.0 0.0136 0.0002
──────────┴──────────────────────────────

  VARIANCE DECOMPOSITION (in percent)

──────────┬───────
 VARIABLE │ eps_A
──────────────────
        Y │ 1.0
        C │ 1.0
        K │ 1.0
        L │ 1.0
        A │ 1.0
        R │ 1.0
        W │ 1.0
        I │ 1.0
    OBS_C │ 1.0
──────────┴───────

  CORRELATION MATRIX

───────┬───────────────────────────────────────────────────────────────────────────
       │ Y C K L A R W I OBS_C
───────────────────────────────────────────────────────────────────────────────────
     Y │ 1.0 0.8339 0.7491 0.7759 0.9895 0.4311 0.9485 0.906 0.4678
     C │ 0.8339 1.0 0.9903 0.2989 0.7455 -0.1385 0.9658 0.5219 0.0523
     K │ 0.7491 0.9903 1.0 0.1634 0.6457 -0.2748 0.9204 0.3983 -0.055
     L │ 0.7759 0.2989 0.1634 1.0 0.8589 0.9037 0.5362 0.97 0.7491
     A │ 0.9895 0.7455 0.6457 0.8589 1.0 0.5568 0.8929 0.9576 0.5513
     R │ 0.4311 -0.1385 -0.2748 0.9037 0.5568 1.0 0.123 0.7725 0.7539
     W │ 0.9485 0.9658 0.9204 0.5362 0.8929 0.123 1.0 0.7252 0.2499
     I │ 0.906 0.5219 0.3983 0.97 0.9576 0.7725 0.7252 1.0 0.6829
 OBS_C │ 0.4678 0.0523 -0.055 0.7491 0.5513 0.7539 0.2499 0.6829 1.0
───────┴───────────────────────────────────────────────────────────────────────────

  AUTOCORRELATION COEFFICIENTS

───────┬────────────────────────────────────────
       │ 1 2 3 4 5
────────────────────────────────────────────────
     Y │ 0.9403 0.8843 0.8318 0.7826 0.7365
     C │ 0.9945 0.9859 0.9746 0.961 0.9454
     K │ 0.998 0.9924 0.9837 0.9723 0.9586
     L │ 0.8773 0.7664 0.6662 0.5757 0.4942
     A │ 0.9226 0.8512 0.7853 0.7245 0.6684
     R │ 0.8867 0.7839 0.6907 0.6064 0.5301
     W │ 0.9764 0.952 0.9269 0.9014 0.8756
     I │ 0.8919 0.7937 0.7046 0.6237 0.5504
 OBS_C │ 0.2849 0.2469 0.2126 0.1817 0.154
───────┴────────────────────────────────────────

 * Status: success

 * Candidate solution
    Final objective value: -2.243469e+02

 * Found with
    Algorithm: BFGS

 * Convergence measures
    |x - x'| = 2.33e-02 ≰ 0.0e+00
    |x - x'|/|x'| = 7.47e-03 ≰ 0.0e+00
    |f(x) - f(x')| = 1.80e-03 ≰ 0.0e+00
    |f(x) - f(x')|/|f(x')| = 8.03e-06 ≤ 1.0e-05
    |g(x)| = 5.74e-01 ≰ 1.0e-08

 * Work counters
    Seconds run: 0 (vs limit Inf)
    Iterations: 2
    f(x) calls: 5
    ∇f(x) calls: 5

  Posterior mode

────────────┬──────────────────────────────────────────────────────────
 Parameter │ Estimated value Standard error 80% confidence interval
───────────────────────────────────────────────────────────────────────
       rhoA │ 0.9209 0.0341 0.8772 .. 0.9645
 Std(eps_A) │ 0.0444 0.0113 0.03 .. 0.0588
────────────┴──────────────────────────────────────────────────────────

2024-05-25T19:22:50.589: End parse_statements!
2024-05-25T19:22:50.589: End parser

```

---

<div class="post-metadata">

**Author:** ![mcreel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcreel/32/30088_2.png) [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Post date:** [May 26, 2024, 5:50am UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/9 "2024-05-26T05:50:12Z")

</div>

I simply forgot the semicolon at the end of

```julia
context = @dynare "RBCmj1";

```

With that, everything is fine. Many thanks!

Edit: running it on my own model, I can say that it is impressively fast compared to Dynare on Octave.

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/micheljuillard/32/10555_2.png) [@MichelJuillard](https://discourse.julialang.org/u/MichelJuillard)\
**Post date:** [May 26, 2024, 6:38am UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/10 "2024-05-26T06:38:50Z")

</div>

👍

---

<div class="post-metadata">

**Author:** ![mcreel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcreel/32/30088_2.png) [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Post date:** [May 26, 2024, 5:47pm UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/11 "2024-05-26T17:47:39Z")

</div>

Do you prefer questions about Dynare.jl here, or on the Dynare forum? I do have a few questions.

Regarding testing, I have done MCMC, order=1, with a model of my own, no problems.

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/micheljuillard/32/10555_2.png) [@MichelJuillard](https://discourse.julialang.org/u/MichelJuillard)\
**Post date:** [May 26, 2024, 6:31pm UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/12 "2024-05-26T18:31:38Z")

</div>

Both are OK for me, but for the users it would be better to have them in a single place. Let’s have the questions on the Dynare forum ([https://forum.dynare.org](https://forum.dynare.org)).  
If the question or the suggestion is more about the Julia implementation then maybe they are better here, but each question should have its own thread. Looking forward to your input.  
You are also welcome to PM me

---

<div class="post-metadata">

**Author:** ![McNelis-CMML](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcnelis-cmml/32/220056_2.png) [@McNelis-CMML](https://discourse.julialang.org/u/McNelis-CMML)\
**Post date:** [December 24, 2025, 5:45am UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/13 "2025-12-24T05:45:01Z")

</div>

Hi Michele, when you get a chance, I have had problems using perfect foresight with dynare julia. The .mod file runs ok in Matlab for perfect foresight, and the context runs ok in the julia version, but I get errors with the set of commands in Julia, this is the comannd I use in Julia: Dynare.perfect\_foresight!(  
context = context,  
periods = 1000,  
datafile = “shocks\_RBC6.csv”,  
display = true,  
maxit = 50, mcp = true,  
tolf = 1e-5, tolx = 1e-5)

error message; ArgumentError: Invalid buffers for SparseMatrixCSC construction n=72, colptr=75-element Vector{Int64}, rowval=90-element Vector{Int64}, nzval=90-element Vector{Float64}

I am using Julia 1.12 and the latest version of Dynare.jl I have had no problems with the stoch\_simul but I want to try the perfectforesight solver as well. Thanks much.

---

<div class="post-metadata">

**Author:** ![McNelis-CMML](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcnelis-cmml/32/220056_2.png) [@McNelis-CMML](https://discourse.julialang.org/u/McNelis-CMML)\
**Post date:** [December 24, 2025, 5:58am UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/14 "2025-12-24T05:58:53Z")

</div>

Actually elimating the varexo\_det for varexo, and putting in zeros for the shocks at the start and end for the steady states of the shocks get the perfect foresight to solve but it is not reading in the shocks, all I get is steady state values for the simulated variables. Any reason why the shocks are not being read in, only zeros?

---

<div class="post-metadata">

**Author:** ![MichelJuillard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/micheljuillard/32/10555_2.png) [@MichelJuillard](https://discourse.julialang.org/u/MichelJuillard)\
**Post date:** [December 24, 2025, 9:37am UTC](https://discourse.julialang.org/t/ann-dynare-jl-is-now-ready-for-testing/108177/15 "2025-12-24T09:37:14Z")

</div>

Dear Paul

Thank you for your message. Can you provide an example please?

All the best

Michel
