# Preaching Julia to academic economists (PhD students)

**URL:** <https://discourse.julialang.org/t/preaching-julia-to-academic-economists-phd-students/16192>\
**Category:** Teaching & Outreach\
**Created:** [October 11, 2018, 4:42pm UTC](https://discourse.julialang.org/t/preaching-julia-to-academic-economists-phd-students/16192 "2018-10-11T16:42:32Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![IljaK91](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iljak91/32/44301_2.png) [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Post date:** [October 11, 2018, 4:42pm UTC](https://discourse.julialang.org/t/preaching-julia-to-academic-economists-phd-students/16192/1 "2018-10-11T16:42:32Z")

</div>

Hi guys,

similar to [this thread](https://discourse.julialang.org/t/preaching-julia-to-biologists/15058/76), I took the presentation by [Yakir](https://discourse.julialang.org/u/yakir12/summary) and did some modifications to talk more about things that are relevant for economics PhD students. The presentation took one hour and there was some interest.

You can find my markdown files etc. [here](https://github.com/IljaK91/whyjulia) and the presentation itself [here](https://iljak91.github.io/#/).

Any feedback is highly appreciated 🙂

Ilja

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 11, 2018, 5:03pm UTC](https://discourse.julialang.org/t/preaching-julia-to-academic-economists-phd-students/16192/2 "2018-10-11T17:03:59Z")

</div>

1. I think it is AOT, not JIT. But I would not worry too much about this and drop JIT too, just say that the type system is designed so that generic code can be compiled specialized to concrete types.

2. Handling `NaN` correctly is not specific to Julia, but the IEEE 754 floating point standard which pretty much everyone uses.

3. Overhead to foreign calls is not necessarily zero. It is small in the ideal case.

4. Instead of bullet points, I would just work through small example, eg write a toy problem and demonstrate AD on it.

---

<div class="post-metadata">

**Author:** ![Paul\_Soderlind](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul_soderlind/32/1753_2.png) [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Post date:** [October 11, 2018, 7:52pm UTC](https://discourse.julialang.org/t/preaching-julia-to-academic-economists-phd-students/16192/3 "2018-10-11T19:52:48Z")

</div>

Hi,  
it’s a useful (and nice looking) presentation. However, I suggest making the presentation a bit more practical (similar to Tamas\_Papp’s 4th point). This may well speak more directly to the students.

I would also suggest adding a few more examples of what is out there in terms of stats/econometrics, and a speed comparison (of a tricky non-linear model) with R wouldn’t hurt.

---

<div class="post-metadata">

**Author:** ![IljaK91](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iljak91/32/44301_2.png) [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Post date:** [October 11, 2018, 8:53pm UTC](https://discourse.julialang.org/t/preaching-julia-to-academic-economists-phd-students/16192/4 "2018-10-11T20:53:42Z")

</div>

Thanks for the comments! Indeed, I was thinking about giving a small example, but didn’t have one ready before the presentation. I’ll try to think of something and include it.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [October 12, 2018, 7:46am UTC](https://discourse.julialang.org/t/preaching-julia-to-academic-economists-phd-students/16192/5 "2018-10-12T07:46:21Z")

</div>

I would do maximum likelihood estimation of a simple (and I mean embarrassingly simple) structural model. Knowing you audience will help you select the appropriate one.

1. present the model,
2. make up parameters, generate data (this demos Distributions.jl, basic syntax, possibly loops, showing off UTF8 notation, possibly plotting),
3. code up the (log) likelihood,
4. AD through the likelihood with ForwardDiff.jl seamlessly (magic!),
5. maximize it with Optim.jl.

---

<div class="post-metadata">

**Author:** ![IljaK91](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iljak91/32/44301_2.png) [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Post date:** [October 12, 2018, 7:58am UTC](https://discourse.julialang.org/t/preaching-julia-to-academic-economists-phd-students/16192/6 "2018-10-12T07:58:00Z")

</div>

This sounds like a good idea! I will look into this once I have some time on my hands 🙂

---

<div class="post-metadata">

**Author:** ![KZiemian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kziemian/32/9020_2.png) [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Post date:** [October 21, 2018, 7:03pm UTC](https://discourse.julialang.org/t/preaching-julia-to-academic-economists-phd-students/16192/7 "2018-10-21T19:03:20Z")

</div>

Can you explain what is AD?

---

<div class="post-metadata">

**Author:** ![KZiemian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kziemian/32/9020_2.png) [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Post date:** [October 21, 2018, 7:05pm UTC](https://discourse.julialang.org/t/preaching-julia-to-academic-economists-phd-students/16192/8 "2018-10-21T19:05:06Z")

</div>

What is a difference between JIT and AOT (ahead of time compiler?)? Or maybe it is wrong place for discussion on this topic?

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [October 21, 2018, 7:51pm UTC](https://discourse.julialang.org/t/preaching-julia-to-academic-economists-phd-students/16192/9 "2018-10-21T19:51:50Z")

</div>

> Can you explain what is AD?

AD is automatic differentation.  
[ForwardDiff.jl](https://github.com/JuliaDiff/ForwardDiff.jl) is robust, while [Zygote.jl](https://github.com/FluxML/Zygote.jl) is new and exciting – much faster for large dimensional inputs, and also solves one of `ForwardDiff`’s major downsides: that it requires code to have been written in a generic fashion.  
Eventually, we’ll have [Capstan.jl](https://github.com/JuliaDiff/Capstan.jl) too. It will probably be the default.  
The last major ones that springs to mind are [AutoGrad.jl](https://github.com/denizyuret/AutoGrad.jl), which is used by [Knet.jl](https://github.com/denizyuret/Knet.jl), and ReverseDiffSparse which has now been integrated into [JuMP.jl](https://github.com/JuliaOpt/JuMP.jl). There are other libraries.

I encourage you to give it a try!  
Definitely feels like magic (to me).

> What is a difference between JIT and AOT (ahead of time compiler?)? Or maybe it is wrong place for discussion on this topic?

JIT is like Java, where a compiler can use runtime information to optimize “hot” code.  
Julia’s compilation is more like `C++`, except Julia’s compiler procrastinates until the first time you call a function with the given combination of argument input types. When you do that, it compiles a version of the function specialized for those argument types in more or less the same way `C++` would using LLVM.

---

<div class="post-metadata">

**Author:** ![KZiemian](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kziemian/32/9020_2.png) [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Post date:** [October 26, 2018, 2:16pm UTC](https://discourse.julialang.org/t/preaching-julia-to-academic-economists-phd-students/16192/10 "2018-10-26T14:16:31Z")

</div>

Thank you and I apologized for not responding earlier.
