Finance and Economics Use Cases

@pkofod Did anyone ever make an rrule for Optim using ChainRulesCore? Maybe this is easier to see with existing code rather than talking in the abstract?

But the principle @Albert_Zevelev is pretty easy. If you have the calculation of a function (which is the forward or primal calculation in ML-speak) then you can look at derivatives around that solution using the implicit funciton theorem and other calculus tricks. I think in the case of your function doing constrained optimization it is just solving Envelope theorem - Wikipedia but maybe it is more subtle. In ML speak that is the “reverse” calculation which brings you back to the gradient from the underlying calculation of the function. Introduction · ChainRules is the package that we can all use to define these rules. And once defined, they can compose in any julia code.

2 Likes