Member-only story
Stochastic differentiation
A simple introduction with Python.
In my previous article https://oscarnieves100.medium.com/the-building-blocks-of-stochastic-calculus-part-ii-f7ab2704a8b1 I discussed Poisson processes and their functions, as well as some examples of Brownian motion with jumps. With those tools at our disposal, we can now delve into the topic of stochastic differentiation.
Let us begin by mentioning one crucial property of stochastic processes: they are nowhere differentiable. Let us look at a simple random walk X(t) = σW(t) or Brownian motion:

Does X(t) look differentiable anywhere? Let us recall that for a function f(t) to be differentiable somewhere it has to be smooth AND continuous. The ‘jaggedness’ of X(t) in this case suggests it is nowhere smooth, therefore nowhere differentiable, right? Not quite so. In fact, any function of W(t) can be thought of as a fractal, because zooming into it arbitrarily reveals non-smoothness throughout, and the same sort of jaggedness repeats itself over and over again no matter how much we zoom into it.
Enter Kiyosi Itô, a Japanese mathematician who is considered the father of stochastic calculus. He developed a branch of calculus known as Itô calculus, which explains how to compute derivatives and integrals of stochastic processes like W(t). By contrast, there is an equivalent (yet different) approach to stochastic calculus, known as Stratonovich calculus, which is often preferred amongst physicists. Regardless, we will focus on Itô calculus here as it is more widely used.
The first fundamental result from Itô calculus is the so-called Itô formula for the differential of F = f(x,t), where t is time and x(t) is a stochastic process in time:
here, the differential dF is defined, and is obtained from using a Taylor series expansion on the function f(x,t). What is essential to note here is that the Taylor expansion is truncated and any terms of higher order (namely orders of dt² or dx³) are ignored because they are considered to be too small to contribute anything significant. Essentially, when dealing with stochastic processes, we don’t talk about derivatives in the usual sense dF/dt which are generally undefined, but rather in terms of differential quantities like dF which are defined. Let us have a look at a few examples.