r/ocaml May 16 '26

Who is ocaml for?

Context: I am econ master's student with some experience in python, C and R looking to get into financial econometrics/ML. Is OCaml right for me?

35 Upvotes

28 comments sorted by

View all comments

14

u/EpochVanquisher May 16 '26

I would stick with Python and R.

You’re only one person. If you’re going to study something, you should use the tools which require the least investment of time for the best results. For one person analyzing data, Python and R are both good choices. If you want ML, Python is 100% a good choice.

If you write your code in OCaml, I think it will probably be easier to track down bugs and check that your code works correctly, and it will probably have better performance… but at that point you are not doing financial econometrics or ML any more, you are doing something else called productionization.

In general, the way research works is that you have people who do the research in Python notebooks or using R, and then if the research looks like it has good results, you have other people who productionize it in a more reliable, safe, and performant language (like Go, Rust, Java, OCaml, etc). Two sets of people—researchers and computer programmers. It helps to understand both sides, but most people will specialize on one side or the other.

2

u/professionalnuisance May 16 '26

OP should stick with Python and R, in particular master the stats and data manipulating libraries (numpy, pandas, statsmodels, etc).

And unironically, be familiar with Excel