# The Dynare Project is looking for independent Julia programmers - work remote

**URL:** <https://discourse.julialang.org/t/the-dynare-project-is-looking-for-independent-julia-programmers-work-remote/80593>\
**Category:** Jobs\
**Tags:** jobs\
**Created:** [May 6, 2022, 8:47am UTC](https://discourse.julialang.org/t/the-dynare-project-is-looking-for-independent-julia-programmers-work-remote/80593 "2022-05-06T08:47:20Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Post date:** [July 30, 2022, 1:09am UTC](https://discourse.julialang.org/t/the-dynare-project-is-looking-for-independent-julia-programmers-work-remote/80593/11 "2022-07-30T01:09:46Z")

</div>

There have been a lot of discussions on Domain Specific Languages in the Julia community.  
I briefly noted down some of my opinions [here](https://discourse.julialang.org/t/my-opinions-on-non-dsls-for-solving-intertemporal-optimization-problems-not-just-for-econ/85011).

1. Models that Dynare can solve:  
I look forward to seeing examples of how models can be “stationarized”  
Perhaps you meant similar to this example [Villemot 2013](https://archives.dynare.org/DynareShanghai2013/order1.pdf)  
I also hope `Dynare.jl` will (some day) be able to handle models w/ some discrete decisions (kinks in the value function) (e.g. models where Governments/Households/Firms can default on debt). I’ve only seen these types of models solved with fixed point methods…

2. Solvers that Dynare may one day include:  
In continuous time, the [finite difference](https://benjaminmoll.com/codes/) upwind scheme solves for a value function that is a fixed point of the HJB. These methods can be used to solve for the equilibrium distribution of Heterogeneous agent Bewley/Huggett/Aiyagari models in a [fraction of a second](https://benjaminmoll.com/papers/).  
In discrete time, [Coleman, Lyon, Maliar, Maliar (2020)](https://link.springer.com/article/10.1007/s10614-020-09983-3) solve the stochastic Neoclassical growth model with 7 different fixed point algorithms. They provide replication code, but not a generic package (like [VFIToolkit](https://github.com/vfitoolkit).m which only has the slowest method VFI).  
The literature has all kinds of other examples (which often get forgotten partly bc they are not included into large well maintained open source packages).  
One of my favorites is [FiPIt (2020)](https://www.sciencedirect.com/science/article/pii/S1094202520300028#br0160) (fast global EE iteration w/ occasionally binding constraints)

3. Writing models in Julia vs a separate `.mod` or `.yaml` file:  
The gold standard approach in the Julia ecosystem is to formulate the problem & solver in **the same** Julia language or even in the same program.  
See the `Problem`/`Solve` [approach](https://diffeq.sciml.ai/dev/tutorials/ode_example/) in SciML.  
See the `Model`/`optimize!()` approach in [JuMP](https://jump.dev/JuMP.jl/dev/tutorials/nonlinear/portfolio/).jl & [InfiniteOpt](https://infiniteopt.github.io/InfiniteOpt.jl/stable/examples/Optimal%20Control/consumption_savings/).jl  
[SolveDSGE](https://github.com/RJDennis/SolveDSGE.jl).jl:  
-models are written in a `.txt` file  
-models are parsed in julia `model= retrieve_processed_model(path)`  
-models are solved/simulated/etc w/ various solvers in Julia  
[Dolo](https://github.com/EconForge/Dolo.jl).jl:  
-models are written in a `.yaml` file  
-models are parsed in julia `model = yaml_import(filename)`  
-models are solved/simulated/etc w/ various solvers in Julia  
[BankOfCanada](https://bankofcanada.github.io/DocsEcon.jl/dev/Tutorials/2.simple_RBC/main/).jl:  
-models are written/solved/analyzed in Julia  
[RiskAdjustedLinearizations](https://github.com/chenwilliam77/RiskAdjustedLinearizations.jl).jl  
-models are written/solved/analyzed in Julia  
[EconPDEs](https://github.com/matthieugomez/EconPDEs.jl).jl  
-models are written/solved/analyzed in Julia  
[VFIToolkit](https://github.com/vfitoolkit).m  
-models are written/solved/analyzed in Matlab  
Oren Levintal’s [TaylorProjection](https://sites.google.com/site/orenlevintal/taylor-projection?authuser=0).m  
-models are written/solved/analyzed in Matlab beautifully (using projection and/or perturbation)  
Generically, any “solve” should take a `model` object as an input (and solver parameters), then return a policy function (as a function of parameters) as the output.

Why is it more natural to write down model equations in a separate `.mod` or `.yaml` file, than to write the all the equations in the same Julia program?

1. Your work on Dynare (so far) has provided the world w/ an amazing public good.  
`Dynare.jl` has the potential to go a lot further!

Example following the JuMP/SciML approaches:  
Define model: states/controls/shocks, optimality, transition etc

```julia
α=.33; δ=1.0; β=.98;
f(k; δ=δ,α=α) = (1.0 -δ)*k + (k^α)
df(k;δ=δ,α=α) = (1.0 -δ) + α*(k^(α-1.0))
sdf(cp,c;β=β) = β*((cp/c)^(-1.0))
EE(cp,c,kp,k) = sdf(cp,c)*df(kp) - 1.0 ## optimality condition
T(c, k) = f(k) -c ## transition function kp= T(c,k)

ncgm = DynareModel()
@variable(ncgm , K, state) ## state variables
@variable(ncgm , C, control) ## control variables
@equation(ncgm , EE(cp,c,kp,k)) ## optimality equations
@transition(ncgm , T(c, k)) ## transition function

# now all relevant variables/equations stored in "ncgm"

# Pick your favorite solvers (from the entire Julia ecosystem etc)
tol = 1e-8; maxiters = 100; 
PPP = PerturbationScheme(ss,1.0,"third") # SolveDSGE.jl
soln_to = solve(ncgm, PPP)

CCC = ChebyshevSchemeDet(ss,chebyshev_nodes,[31,31,31],5,[0.07 3.2 0.8; -0.07 2.9 0.6],tol,1e-6,maxiters,:newton)
soln_cheb = solve(ncgm, CCC)

# if there was an Euler Equation Iteration type fixed point solver 
soln_ee = solve(ncgm, EE)

# Similarly for VFI/EC/PFI/etc 
# Note: to use some Fixed Point solvers the user would need to add
# the appropriate Envelope conditions etc as explained in my other post
solve(ncgm, VFI(), guess; maxiter=1000, verbose=false)
solve(ncgm, VFI_EGM(), guess; maxiter=1000, verbose=false)
solve(ncgm, VFI_ECM(), guess; maxiter=1000, verbose=false)
solve(ncgm, dVFI_ECM(), guess; maxiter=1000, verbose=false)
solve(ncgm, PFI(), guess; maxiter=1000, verbose=false)
solve(ncgm, PFI_ECM(), guess; maxiter=1000, verbose=false)
solve(ncgm, EE(), guess; maxiter=1000, verbose=false)

# once a model is solve, using appropriate method(s) the user has a solution object w/ a policy function
# the model can be automatically simulated using the transition & policy functions 

```

---

_[View the full topic](https://discourse.julialang.org/t/the-dynare-project-is-looking-for-independent-julia-programmers-work-remote/80593)._
