jonasanso / ergo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ergo

Learning ergodicity in economics using examples.

Ergodicity means the ensemble average equals the time average.

Peters coin game (additive)

Suppose we have a gamble that has additive dynamics. Win 5$ for heads, lose 4$ for tails.

out/ergo/native/dest/ergo -m additive --initial 100 --win 5 --lose 4 | ./plot-it

Peters coin game (multiplicative)

Now consider a gamble with multiplicative dynamics.

Win 50% of your current wealth for heads, lose 40% of your current wealth for tails.

out/ergo/native/dest/ergo -m multiplicative | ./plot-it

Screenshot 2021-05-20 at 17 03 16 (1)

Dependencies

Install Mill http://www.lihaoyi.com/mill/ Compiling it with Graal VM following the same approach as https://github.com/jonasanso/hello-world-scala-graalvm Install jplot https://github.com/rs/jplot

Reads

About


Languages

Language:Scala 100.0%