# Finance and Economics Use Cases

**URL:** <https://discourse.julialang.org/t/finance-and-economics-use-cases/9452>\
**Category:** Finance and Economics\
**Created:** [March 2, 2018, 2:14pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452 "2018-03-02T14:14:30Z")\
**Posts on this page:** 20\
**Page:** 5

<div class="post-metadata">

**Author:** ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Post date:** [August 25, 2021, 9:55pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/82 "2021-08-25T21:55:17Z")

</div>

Thank you for your perspective. I think we are 100% on the same page here and take your point. The lack of formal programming for even graduate students is a crisis in the profession. And not just programming, but basic software engineering and numerical analysis principles as well.

Perhaps the only difference is that I see the DSGE oriented stuff as of sufficiently narrow interest that people are better off learning those tools for other sorts of models (and then just let Dynare take care of the basic perturbation solutions) and spend their time learning to program on global solutions/etc. wher there isn’t a package that implements it. But I acknowledge that part of that may be my bias in what are likely to be useful methods for cutting edge research.

These things are also not mutually exclusive: teach people to program a basic perturbation solution, maybe using autodifferentiation as an example, replicate the dynare solution, then tell them to throw out there own code (since using trusted and tested packages is the first rule of software engineering).

---

<div class="post-metadata">

**Author:** ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)\
**Post date:** [August 26, 2021, 1:56am UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/83 "2021-08-26T01:56:25Z")

</div>

This discussion reminds me of a conversation Theodore Gray had some decades ago:  
[https://theodoregray.com/BrainRot/](https://theodoregray.com/BrainRot/)

---

<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:** [August 26, 2021, 1:40pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/84 "2021-08-26T13:40:31Z")

</div>

That Theodore Gray piece was very good, thanks. The unthinking or uninformed use of tools certainly occurs quite often. In economics, people often use econometric software that has canned routines (e.g., Stata, Gretl, or many others) to estimate models that are wildly inappropriate for their data. This isn’t the fault of the tool, it just means that the student has not learned well, or their program of studies is not getting through to them for some reason. In amateur carpentry, I bet that many people pick up the wrong saw more often than not!

Students are increasingly demanding training in computation and data analysis from graduate programs (and also undergraduate), and I expect that this sort of course will become fairly standard in the next several years. A free language like Julia that runs well on the main operating systems is well positioned to grow within economics.

---

<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:** [August 30, 2021, 11:32am UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/85 "2021-08-30T11:32:48Z")

</div>

It was great to read such an interesting discussion on Dynare, where I can agree with almost all sides to a large extent. I can’t resist adding my 2 cents though.

The main goal of empirically oriented subfields of economics (macro, intl macro, finance, trade) is to understand economic data using structural models. This usually involves solving the model, estimating (or calibrating) its parameters, and then (in the ideal case) model criticism to understand its limitations.

The problem is that this the current state of the art for the above requires so methodology that it stretches the limitations of a graduate program, even for students with a macro or related focus. Teaching the very basics of the foundations for numerical linear algebra, first- and higher-order perturbations, global methods, sparse grids, AD, let alone the various practical tools for Bayesian estimation, could easily take 3–5 years. This is a huge investment for what is a very useful, but at the same time very narrowly focused set of skills.

So while black-box can be misused without deeper understanding, it is great that they exist, otherwise _teaching_ macro would become impossible, it is just too overwhelming. What the Julia ecosystem could strive for is a composable set of tools which can be tweaked and modified on demand as necessary.

---

<div class="post-metadata">

**Author:** ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)\
**Post date:** [August 30, 2021, 12:05pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/86 "2021-08-30T12:05:19Z")

</div>

> [@Tamas\_Papp](#):
>
> The problem is that this the current state of the art for the above requires so methodology that it stretches the limitations of a graduate program

So what can young people do to advance the field, and advance in the field? Keep pushing less demanding publications, while learning on the side until reaching a productive stage?

---

<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:** [August 30, 2021, 12:32pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/87 "2021-08-30T12:32:19Z")

</div>

Not sure I have good advice on this. I would recommend joining a project with more senior coauthors so that one does not have to learn _everything_ at once. My understanding is that this is quite common in the natural sciences, which have similar methodological demands. But I am aware of the trade-offs regarding career advancement.

Also, I think that that demand for numerically trained quantitative macroeconomists _outside academia_ is very countercyclical. When things are going well, no one really cares, when the next crisis hits then it is _“we need estimated structural models about X ASAP”_… until it is over and we don’t. But maybe I should not complain, quantitative epidemiologists had it worse before COVID hit.

---

<div class="post-metadata">

**Author:** ![arunsm](https://avatars.discourse-cdn.com/v4/letter/a/91b2a8/32.png) [@arunsm](https://discourse.julialang.org/u/arunsm)\
**Post date:** [August 30, 2021, 1:33pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/88 "2021-08-30T13:33:33Z")

</div>

At least from a pedagogical perspective, perhaps there could be an “Assumptions” flag, like the verbose flag we have for warnings, that autogenerated alerts for students/users on the assumptions being made on the calculation.

This would be moving towards Mathematica-type output, where assumptions are usually coupled with answers. This would be useful for audits as well, if these assumptions were assertible conditions.

---

<div class="post-metadata">

**Author:** ![HJWang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hjwang/32/28697_2.png) [@HJWang](https://discourse.julialang.org/u/HJWang)\
**Post date:** [August 30, 2021, 2:38pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/89 "2021-08-30T14:38:07Z")

</div>

Since this thread is about the econ use of Julia, I’d like to take the opportunity to introduce my package [`SFrontiers.jl`](https://hungjenwang1991.github.io/SFrontiers.jl/) which provides commands to estimate stochastic frontier (SF) models. SF models are often used in productivity and efficiency analysis. I just put the package online two days ago and haven’t registered it yet. The web page has [a detailed example in Jupyter notebook](https://hungjenwang1991.github.io/SFrontiers.jl/ex_detail.html) for easier exploration. Comments and suggestions are welcome.

There are at least two reasons why Julia is particularly useful for estimating SF models.

1. The parametric versions of the models are almost always estimated by MLE. Because they are highly nonlinear, the estimation is often numerically challenging. Julia’s `Optim.jl` coupled with `ForwardDiff.jl` substantially reduces the problem. The coding time is much shorter now and the estimation quality is higher. I used to code in Stata and spent a lot of time getting the analytic forms of gradients and Hessians to assist in the estimation. They really helped. But that’s 20 years ago. It’s not a smart thing to do today when you have Julia.

2. Simulation-based methods are becoming important in this field. The speed of Julia makes those methods much more practical. I haven’t done a serious benchmarking, but I have seen a maximum simulated likelihood example where a typical (not optimized) Julia code runs more than 10 times faster than a typical Stata code does, and at least 2 or 3 times faster than a quite optimized code (which uses compiled functions).

---

<div class="post-metadata">

**Author:** ![jlperla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jlperla/32/34332_2.png) [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Post date:** [September 9, 2021, 8:32pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/90 "2021-09-09T20:32:22Z")

</div>

See ["Quantitative Economics with Julia" lecture notes updated to Julia 1.6, VS Code, and GitHub Actions](https://discourse.julialang.org/t/quantitative-economics-with-julia-lecture-notes-updated-to-julia-1-6-vs-code-and-github-actions/67956) for a summary of the new QuantEcon julia lecture notes release.

A lot of effort was put into software engineering tooling, workflows, etc. in this revision.

My personal feeling is that changing people’s workflows to support reproducibility is our most important goal, and the tools can help. To me, the eventual nail in the coffin of matlab is not its speed (it is actually pretty fast in practice since so many algorithms are dominated by linear algebra) nor its clunky syntax (far superior to python in some cases), but rather that it cannot support modern software engineering.

Julia is a great language for reproducibility and collaboration partially because it is new enough that these things (e.g. reproducible environments, CI, unit testing, collaboration workflows, package discovery) were designed in from its inception. So if a student learns these things correctly with julia, they can apply them with R, Python, Stan, etc.

---

<div class="post-metadata">

**Author:** ![brett\_knoss](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brett_knoss/32/13050_2.png) [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Post date:** [October 5, 2021, 5:46am UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/91 "2021-10-05T05:46:27Z")

</div>

I created a double entry book keeping package, that I’d like to get a point I can register. If I do the same thing with relational database, I should be able to tie to inventory management and track expenses to perform optimization.

---

<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:** [December 2, 2021, 12:33am UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/92 "2021-12-02T00:33:11Z")

</div>

Jeremy Greenwood & Ricardo Marto (UPenn) have a book in progress “Numerical Methods for Macroeconomists with Julia and Matlab Codes”

Note: the current draft only has Matlab codes (but Julia codes are promised in the title)  
[http://www.jeremygreenwood.net/papers/NM4M.pdf](http://www.jeremygreenwood.net/papers/NM4M.pdf)

---

<div class="post-metadata">

**Author:** ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)\
**Post date:** [December 2, 2021, 12:44am UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/93 "2021-12-02T00:44:06Z")

</div>

Supposedly Ken Judd is writing a second edition of his famous book. This one seems to be on track to release first.  
Sources:

> **[Books - Kenneth L. Judd](https://kenjudd.org/books/)**
>
> Numerical Methods in Economics, 1st Edition Numerical Methods in Economics, 2nd Edition in progress

> **[About the Book - 2nd Edition - Numerical Methods in Economics](https://numericalmethodsineconomics.com/about-the-book-2nd-edition/)**
>
> To harness the full power of computer technology, economists need to use a broad range of mathematical techniques. In this book, Kenneth Judd presents techniques from the numerical analysis and applied mathematics literatures and shows how to use...

Aside, I wonder what people think of more general books to solve dynamic problems, like this one:  
[https://castlelab.princeton.edu/RLSO/](https://castlelab.princeton.edu/RLSO/)

---

<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:** [April 27, 2022, 12:32am UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/94 "2022-04-27T00:32:06Z")

</div>

Hey all, this classic textbook now has some Julia code (in addition to Fortran-Python-GAUSS).  
-They have a [YouTube video](https://www.youtube.com/watch?v=D2tl5imrrNk) w/ code performance comparisons  
(Seems like their Julia code can be optimized)

[![](https://global.discourse-cdn.com/julialang/original/3X/7/8/78b49e5249a91c03525bcdef74ce3088c3f4baf4.jpeg "The Overlapping Generations Model with Income Uncertainty + PYTHON, JULIA & GAUSS Codes") ](https://www.youtube.com/watch?v=D2tl5imrrNk)

> **[Dynamic General Equilibrium Modelling, Computational Methods and Applications](https://www.uni-augsburg.de/de/fakultaet/wiwi/prof/vwl/maussner/dgebook/)**
>
> None

---

<div class="post-metadata">

**Author:** ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)\
**Post date:** [April 27, 2022, 12:36am UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/95 "2022-04-27T00:36:55Z")

</div>

wow gauss 🙈

---

<div class="post-metadata">

**Author:** ![pkofod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pkofod/32/2179_2.png) [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Post date:** [April 29, 2022, 2:27pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/96 "2022-04-29T14:27:13Z")

</div>

Wouldn’t be dynamic economics if there wasn’t any gauss code 😃

---

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [April 29, 2022, 3:06pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/97 "2022-04-29T15:06:54Z")

</div>

Very cool! I leaned on that book quite a bit to learn those topics.

---

<div class="post-metadata">

**Author:** ![Zhiwei125](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhiwei125/32/42593_2.png) [@Zhiwei125](https://discourse.julialang.org/u/Zhiwei125)\
**Post date:** [September 11, 2022, 4:51pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/98 "2022-09-11T16:51:36Z")

</div>

🤩 😊 thanks a lot!

---

<div class="post-metadata">

**Author:** ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)\
**Post date:** [January 15, 2023, 2:50pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/99 "2023-01-15T14:50:07Z")

</div>

Hi @pazzo83

Is QuantLib.jl under active development? I was trying to see if I could use it for some basic stuff like USD swaps curve fitting, but some bits are either sale (for example the US business calendars don’t include June 19th) or not ported from upstream (overnight indices like SOFR).

I’m an end user (ie, I’d run a curve fitter to live data streamed from Bloomberg for my trading needs) but I probably don’t have the skills to contribute to the port itself. Happy to help from that end though.

---

<div class="post-metadata">

**Author:** ![Alec\_Loudenback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alec_loudenback/32/278_2.png) [@Alec\_Loudenback](https://discourse.julialang.org/u/Alec_Loudenback)\
**Post date:** [January 15, 2023, 9:59pm UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/100 "2023-01-15T21:59:48Z")

</div>

Check Yields.jl or InterestRates.jl as well for curves.

---

<div class="post-metadata">

**Author:** ![sob](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@sob](https://discourse.julialang.org/u/sob)\
**Post date:** [January 16, 2023, 12:08am UTC](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452/101 "2023-01-16T00:08:12Z")

</div>

Thank you @Alec_Loudenback for pointing this out. Unfortunately they don’t provide the facilities that are in Quantlib (C++).

[Previous page](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452.md?page=4)

[Next page](https://discourse.julialang.org/t/finance-and-economics-use-cases/9452.md?page=6)
