Blog posts

2021

How to optimize Julia SDEs?

11 minute read

Published:

Hi all!. In this post I’ll show how to optimize the simulation of a Stochastic Differential Equations (SDEs) System written in Julia Language. To that end I’ll DifferentialEquations.jl and StaticArrays.jl libraries. Firstly, stack and heap memory types will be defined. Then, the Longstaff-Schwartz SDEs system will be defined, and then translated into Julia code. It’ll be written in two flavours: the in-place (iip) and out-of-place (oop) versions will be shown. For the oop system the StaticArrays.jl package will be used in order to provide stack allocated arrays. Finally, the two implementations will be benchmarked in both heap allocations and elapsed time for adaptive and non-adaptive discretization schemes.

Automatic differentiation for financial options

19 minute read

Published:

Hi, all!. Today I’ll gonna talk about automatic differentiation (AD) applied to computing financial options greeks. I’ll use jax library to compute the greeks of an european option by means of its reverse mode automatic differentiation functionality.

How to speed up python code?

16 minute read

Published:

Hello everybody!. Today I’ll talk about performance in Python and how to improve it when we are dealing with nested for loops and mathematical operations.