Roman Suzi
2 min readMar 15, 2020

--

The article have struck gold: Being myself from math background, I hardly ever understood people can have difficulties in interpreting a math formula. When I studied programming, converting math formula to code was the usual (and dull) exercise.

However, in math, everything is more complex than it can appear. First of all, a variable can have a lot of different types. For example, some equation can be purely functional — far beyond what Python, Haskell or FORTRAN can handle. Or if the equation in question is stochastic — some variables can be random variables (and their domains are quite involved spaces / algebraic structures).

Unless you are using some proof assistant (like Coq) with a special-purpose library to deal with those types and/or an involved computer-algebra system, chances are… you just can’t turn every equation in an article you read into code.

This is where one needs to understand the math behind those formulae, know specific field notation, and either find whether authors of the article describing new shiny method provided any algorithms (= set of equations, which are dumbed down for numerical calculations) or try to reconstruct the algorithm based on the available equations. Many times an article describes only a new part and to get the rest one will need to find the referenced works, recursively.

All that said, translating numerical formula to the code is probably the smallest problem of all. The harder problem is to build a numerical model from whatever model researches provide (differential or integral equations, stochastic equations, functional, etc, etc). It’s not a mechanical process: There are many traps in statistics and machine learning in particular even mature researches as users of statistics fall into. No assumption can be left unaccounted for.

For example, even in a “simple” case of estimating population variance one should be aware of what is really available and some properties of the estimators being used. (The worst of all — the problem may not be immediately obvious as the resulting wrong algorithm will be only a bit off, but the problem may be discovered later and cause a bigger shame.)

In case one wants to master math, there is no other way but build strong intuition for it. Read textbooks from fundamentals to the area of interest. It will take time, but the payoff will be much bigger than just coding simple numerical models into the code.

As is said in The Pragmatic Programmer book: “Don’t Use … Code You Don’t Understand”.

--

--

No responses yet