# Julia and Demography

**URL:** <https://discourse.julialang.org/t/julia-and-demography/23773>\
**Category:** Modelling & Simulations\
**Created:** [May 2, 2019, 12:21pm UTC](https://discourse.julialang.org/t/julia-and-demography/23773 "2019-05-02T12:21:14Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbacelar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sbacelar/32/4359_2.png) [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Post date:** [May 2, 2019, 12:21pm UTC](https://discourse.julialang.org/t/julia-and-demography/23773/1 "2019-05-02T12:21:14Z")

</div>

Is there any work on (computational) demography using `Julia`?

---

<div class="post-metadata">

**Author:** ![mhinsch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mhinsch/32/26676_2.png) [@mhinsch](https://discourse.julialang.org/u/mhinsch)\
**Post date:** [May 31, 2019, 7:54pm UTC](https://discourse.julialang.org/t/julia-and-demography/23773/2 "2019-05-31T19:54:42Z")

</div>

I’m using it for agent-based simulation of human migration (first results to be presented at ALife 2019 in Newcastle).

---

<div class="post-metadata">

**Author:** ![sbacelar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sbacelar/32/4359_2.png) [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Post date:** [May 31, 2019, 9:54pm UTC](https://discourse.julialang.org/t/julia-and-demography/23773/3 "2019-05-31T21:54:00Z")

</div>

Do you follow work from Max Planck (Sabine Zinn, etc.) about migration?

---

<div class="post-metadata">

**Author:** ![mhinsch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mhinsch/32/26676_2.png) [@mhinsch](https://discourse.julialang.org/u/mhinsch)\
**Post date:** [May 31, 2019, 11:29pm UTC](https://discourse.julialang.org/t/julia-and-demography/23773/4 "2019-05-31T23:29:21Z")

</div>

I’ve met her at a workshop we had last year, but not specifically. If you are interested this is our project’s official web site:  
[https://www.southampton.ac.uk/baps/index.page](https://www.southampton.ac.uk/baps/index.page)

---

<div class="post-metadata">

**Author:** ![sbacelar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sbacelar/32/4359_2.png) [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Post date:** [May 31, 2019, 11:39pm UTC](https://discourse.julialang.org/t/julia-and-demography/23773/5 "2019-05-31T23:39:27Z")

</div>

Thank you. I have been there but did not found anything Julia related, but I started reading a book chapter by Bijak about Modeling in Demography.  
I am mainly interested in ABM simulation of retirement pensions and I am using R and NetLogo. Meanwhile I am learning Julia because I like the cleaner syntax of the language.

---

<div class="post-metadata">

**Author:** ![mhinsch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mhinsch/32/26676_2.png) [@mhinsch](https://discourse.julialang.org/u/mhinsch)\
**Post date:** [June 1, 2019, 9:17am UTC](https://discourse.julialang.org/t/julia-and-demography/23773/6 "2019-06-01T09:17:20Z")

</div>

We’ll have a paper at WinterSim that compares the Julia implementation with one in a DSL (ML3 by the Uhrmacher group in Rostock). I’ll post it here or on ResearchGate when it’s out. In the meantime here’s a simplified version of the model I’m currently working on:  
[https://github.com/mhinsch/RRGraphs\_mini](https://github.com/mhinsch/RRGraphs_mini)

I’ve been doing ABMs (or IBMs as they are called in biology) for a long long time, mostly in C++ for efficiency. With 0.7 Julia finally came close enough to C++ in my own benchmarks (10-20%), so this is the first time I’ve done a full simulation project in Julia.

I have to say, it’s been close to a revelation. It’s much more fun to write, the code is way cleaner and many things that are very hard in C++ are close to trivial in Julia. For example I’m using Parameters.jl for the simulation parameters. Together with ArgParse.jl and a tiny bit of glue code that gives me a 0-overhead parameter file with a nice syntax that at the same time is used to automatically generate command line parameters with proper default values and documentation. Any similar solution I could come up with in C++ would be half as convenient and ten times as ugly.

I’m also using Julia (in a Jupyter notebook) to analyze the simulation results now. Apart from the plotting (gadfly and plots both have their shortcomings) that works really well.

---

<div class="post-metadata">

**Author:** ![sbacelar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sbacelar/32/4359_2.png) [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Post date:** [June 1, 2019, 4:29pm UTC](https://discourse.julialang.org/t/julia-and-demography/23773/7 "2019-06-01T16:29:34Z")

</div>

Creating some competition with `ML3` with Julia would be very interesting. I tried to run your model but I had not enough success. So, I open an issue on GitHub.  
I am very interested to understand what you really want to do with your paper.

---

<div class="post-metadata">

**Author:** ![mhinsch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mhinsch/32/26676_2.png) [@mhinsch](https://discourse.julialang.org/u/mhinsch)\
**Post date:** [June 1, 2019, 5:58pm UTC](https://discourse.julialang.org/t/julia-and-demography/23773/8 "2019-06-01T17:58:20Z")

</div>

Sorry the code didn’t work for you - the README was pretty out of date (thanks BTW, for bringing this to my notice). I’ve updated it, at least the REPL version should work now.

---

<div class="post-metadata">

**Author:** ![mhinsch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mhinsch/32/26676_2.png) [@mhinsch](https://discourse.julialang.org/u/mhinsch)\
**Post date:** [July 21, 2019, 9:52pm UTC](https://discourse.julialang.org/t/julia-and-demography/23773/9 "2019-07-21T21:52:39Z")

</div>

In case anybody is interested, [this](http://abmhub.braintree.com/papers/Hinsch_Bijak.pdf) is a paper I’ll present at ALife next week about the simulation I mentioned earlier in this thread.

---

<div class="post-metadata">

**Author:** ![johnh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnh/32/3615_2.png) [@johnh](https://discourse.julialang.org/u/johnh)\
**Post date:** [July 22, 2019, 7:16am UTC](https://discourse.julialang.org/t/julia-and-demography/23773/10 "2019-07-22T07:16:54Z")

</div>

Ah - demography… not **demon** ography. Perhaps says something about my mind…  
Seriously though this is a fascinating application.

Some years ago I installed an HPC cluster at the UK Health Protection Agency which was used for modelling the spread of epidemics. I guess this uses similar mathematics - infected Person A meets Person B and there is X percent chance of transmitting the disease.
