Finance and Economics Use Cases

To follow up on this thread. I don’t think there is a lot of activity on this domain of the forum because our cases are not specific to economics/ finance. Maybe with more users in the future there could be some conversation on how to solve model x, but as already mentioned above: solving a model is solving a (system of) equations, so plenty of non economists have those problems.
I’m trying to say that activity on this domain of the forum might not be representative of Julia usage among economists.
We all know that Julia has all the ingredients to replace the good old ways. Whether and when that will happen is uncertain, and similar to general adoption of Julia. In economics, Getting seniors to switch is almost impossible- what works, works. That’s why this is going to change mainly at a rate of annual new students having been exposed to Julia, and that’s why I’m teaching it to our grad students.

3 Likes

I would expect that there must be a subset of people who program heavily in existing languages (mostly Matlab) who are sufficiently annoyed by its shortcomings to switch. This is reflected by the constant experimentation with new approaches (eg in the Python ecosystem).

I’m working on a package (DiscreteChoice.jl) for estimating discrete choice models including logit and mixed logit. Should be ready in a couple of weeks.

1 Like

For me my main attachment to Stata is the panel data tools. It’s extremely convenient to be able to do:

xtset person year
reg D.wage D.X $controls
1 Like

The panel data package I developed (soon to be released) has the following syntax

model = EconometricModel(formula::StatsModels.Formula,
                         data::DataFrames.AbstractDataFrame;
                         options::Dict{Symbol,Any} = Dict{Symbol, Any}())
formula = @formula(y ~ a + b * c)
options = @modelops(estimator = RE, vce = hc2,
                    PID = PID, TID = TID)

The API is quite familiar

coeftable(model)
vcov(model)
coef(model)
coefnames(model)
r2(model)
aic(model)

etc… It supports the StatsBase.RegressionModel API.
For fixed effects, @formula(y ~ a + b + (absorb = fe1 + fe2)),
For first-difference @modelops(estimator = FD) # Categorical variables are not differenced
etc.

4 Likes

For Quantlib, once 0.7 gets into release candidate stage, i plan on updating it so it is 0.7/1.0 compatible.

4 Likes

I really like the FinancialToolbox package:

It has exactly the same syntax as Matlab, which allows me to seamlessly translate my Matlab code into Julia code.

5 Likes

For example, the SQL-type logic is not fully developed in Julia. I have run into issues where DataFramesMeta and Query couldn’t complete the tasks I was doing in SAS. Conditional joins are one such example.

1 Like

Personally, I’ve always felt that one of the best use cases for Julia in this general domain is for researching and developing systematic trading strategies. I think the language constructs and features show great promise for making it a highly productive language for prototyping an idea quickly, and also tuning/optimizing the parameters to a trading model. This is a problem space that can become quite computationally expensive, particularly when testing against lots of data and/or somewhat complicated trading rules.

There’s tools in competing languages to this type of work, like quantstrat in R and zipline in Python, but I’ve never found any to be very intuitive. And I think Julia could solve a lot of the deficiencies with these tools by (A) solving major performance issues with both, and (B) using language features like metaprogramming to make things more intuitive to use.

I’ve been working on some packages aimed at making things more productive in this area. (Warning: shameless plug ahead :slight_smile:). If there’s anyone else interested in this space out there, I’d be happy to discuss it more and/or work together on further building out some of the packages I’ve been working on, or else just get some feedback on how to make them better.

6 Likes

I was browsing the Equality of Opportunity project website and noticed they’re explicitly hiring RAs with Julia experience. They say “especially those with programming experience in Stata, SAS, R, Python, and Julia.”

I wonder what they’re using it for. They get access to really interesting data (U.S. tax, census microdata)

1 Like

I suspect that’s just become part for the course. Anytime anyone is looking for data goons Julia comes up in pretty much the same breath. I’m not complaining.

Is your package already out?

QuantEcon seems a nice website both for teaching and general introduction to Julia as well. It is pretty much complete for stated contents, so I think pace of developement is not an issue now. I just wish the course had more econometrics focus as well.

1 Like

Close as it is part of my dissertation which I am defending next semester. Waiting on the last few things such as StatsModels new internals.

As of QuantEcon, I am a developer for the ecosystem (package / lectures) and we released the updated Julia lectures yesterday (https://quantecon.org/news-item/julia-1-0-lectures-released).

We were debating on whether to include more econometrics lectures. Right now we want to prioritize maintaining and improving the current material, but I will probably contribute my material for econometrics during the next academic year. It will probably be Generalized Linear Models through Fisher Scoring covering count, categorical (nominal and ordinal), continuous, instrumental, robust vce, and panel data.

Note that the source code for the lectures is now open source and PR to the Github repository are welcome (e.g., contributing new material).

4 Likes

I think solving DSGE models would be great in Julia, and at some point I reckon dynare or something similar will show up in Julia form.

Central banks and other users of DSGE models of a certain size are computationally constrained.

I think this has been posted before, but…

https://juliacomputing.com/case-studies/ny-fed.html

1 Like

Coincidentally just created a new (unregistered) package today: https://github.com/tbeason/FinEconResearchUtils.jl

Right now it is basically just a meta-package for lots of other packages that I’ve been using, but I’ll slowly add additional functions to it that I also frequently use.

PR’s would be welcome.

1 Like

Yeah good resource. I’ve been meaning to investigate that actually, but need to learn the language a bit better first.

Edit: I accidentally overwrote this with a post for another thread. This used to be, though, a post about new QuantEcon work like GitHub - QuantEcon/Expectations.jl: Expectation operators for Distributions.jl objects, https://github.com/QuantEcon/InstantiateFromURL.jl, https://github.com/QuantEcon/SimpleDifferentialOperators.jl, as well as tooling like https://github.com/arnavs/compiled-binder-example.

Also, the QuantEcon lecture notes for Julia 1.x, lectures.quantecon.org/jl

4 Likes

I’m working in a script to estimate Mixed Logit models based on the codes of Kenneth Train!

Link: https://github.com/ighdez/MultiLogit

Any comments/contributions/sharing are welcome :slight_smile:

2 Likes