# Stochastic Calculus at the Speed of Light

*In this post, I briskly review stochastic calculus. I concentrate on continuous martingales. Continuous martingales have trajectories with infinite first order variation and finite quadratic variation. This forces the development of a specific integration theory. I introduce continuous semimartingales, for which I spell out the Ito formula. I then consider the geometric Brownian motion and the Ornstein Uhlenbeck process.*

## Martingales and the brownian motion

Probability processes come with a probability space \((\Omega,{\cal F},\mathbb{P})\) where the sigma algebra decomposes into a filtration \({\cal F}_{t}\) required to satisfy ‘usual conditions’ (right continuity and completeness).

A martingale is an adapted stochastic process \((M_{t})_{t\in \mathbb{R}_{+}}\) such that \(M_{s}=E_{s}[M_{t}]\) (\(s\leq t\)). We will only work with continuous martingales, i.e. martingales with continuous trajectories (a.e.).

A Brownian motion is a continuous martingale \((B_{t})_{t\in \mathbb{R}_{+}}\) with the following properties:

- \(B_{0}=0,\)
- \(B_{t}-B_{s}\) (\(s<t\)) is a normal random variable with mean \(0\) and variance \(t-s\),
- \(B_{t}-B_{s}\) (\(s<t\)) is independent of \({\cal F}_{s}\).

## Some properties of the Brownian motion

The Brownian motion has independent normally distributed increments.

The Brownian motion is a Markovian process.

The Brownian motion is a Gaussian process: all finite dimensional distributions are jointly normal.

The trajectories of the Brownian motion are very irregular: with probability one, the set of times where \(B(\omega,\cdot)\) is differentiable has Lebesgue measure \(0\).

This is quite unusual for a function. We will see that it forces the first order variation of the Brownian motion to be to almost surely infinite, which prevents standard integration theory to be applied.

## Quadratic variation (1)

The variation of order \(p\) of a process \(M\) over an interval \([0,T]\) is the limit of: \[V^{(p)}(\pi_{[0,T]})(\omega)=\sum_{k=1}^{n}|M_{t_{k}}(\omega)-M_{t_{k-1}}(\omega)|^{p},\] as partitions \(\pi_{[0,T]}=\{t_{0}=0,t_{1},t_{2},\ldots,t_{n}=T\}\) get finer.

There are subtleties around the limiting concept used here, which I will sweep under the rug. All mentionned limits for variations below mean ‘as partitions get finer and finer’.

Finite (first order) variation processes have \(\lim_{\pi_{[0,T]}} V^{(1)}(\pi_{[0,T]})(\omega)<\infty\) a.e.. They are amenable to Lebesgue Stieljes integration trajectory by trajectory. Variations of higher order are equal to \(0\).

## Quadratic variation (2)

For the Brownian motion, we have \(\lim_{\pi_{[0,T]}} V^{(1)}(\pi_{[0,T]})(\omega)=\infty\) and \(\lim_{\pi_{[0,T]}} V^{(2)}(\pi_{[0,T]})(\omega)=T\) a.e.. Variations of higher order are zero.

This feature (finite quadratic variation, infinite first order variation) is true for continuous martingales as well. Their quadratic variation is a stochastic variable however. A continuous martingale has zero quadratic variation if and only of it is a.e. constant.

The quadratic variation process of a martingale is a process noted \([M]_{0,t}\) or \([M]_{t}\) when the starting point is obvious. One can show that it is a finite variation process. Each trajectory of \([M]_{0,t}\) is increasing in \(t\).

Quadratic variation is cumulated variance.

## Quadratic variation (3)

**Levy’s theorem**: a continuous martingale \((M_{t})_{t\in \mathbb{R}_{+}}\) with \(M_{0}=0\) is a Brownian motion if and only if \([M]_{t}=t\) a.e..Similarly, one defines the quadratic covariation \([M,N]_{t}\) between two martingales: \[[M,N]_{t}=\lim_{\pi_{[0,T]}} \sum_{k=1}^{n}(M_{t_{k}}(\omega)-M_{t_{k-1}}(\omega))(N_{t_{k}}(\omega)-N_{t_{k-1}}(\omega)).\]

## Stochastic Integrals (1)

Predictable processes are processes that can be obtained as limits of left continuous adapted processes.

Along the finite variation paths of a finite variation process \((A_{t})_{t\in \mathbb{R}_{+}}\) we can define the integral of a predictable process \((H_{t})_{t\in \mathbb{R}_{+}}\): \[\int_{0}^{t}H_{u}(\omega)dA_{u}(\omega),\] provided \(\int_{0}^{T}|H_{s}(\omega)|\,|dA|_{s}(\omega)<\infty\) a.e..

For a martingale \((M_{t})_{t\in \mathbb{R}_{+}}\), exploiting the existence of a quadratic variation, we can then define the

**stochastic**integral of a predictable process \((H_{t})_{t\in \mathbb{R}_{+}}\) (see below the slide on stochastic integrals and trading gains): \[\int_{0}^{t}H_{u}dM_{u},\] provided \(E_{0}\left[\int_{0}^{t}H_{u}^{2}d[M]_{u}\right]<\infty\).

## Stochastic Integrals (2)

The stochastic integral of a martingale is a martingale of quadratic variation on \([0,T]\): \[\int_{0}^{t}H_{u}^{2}d[M]_{u},\] when \(E_{0}\left[\int_{0}^{T}H_{u}^{2}d[M]_{u}\right]<\infty\).

Suppose the continuous process \(X\) decomposes as \(X_{s}=X_{0}+A_{s}+M_{s}\) where \(A\) is a continuous finite variation process and \(M\) is a continuous martingale, we can define the integral: \[\int_{0}^{t}H_{s}dX_{s}=\int_{0}^{t}H_{s}dM_{s}+\int_{0}^{t}H_{s}dA_{s},\] in the interval \([0,T]\) provided: \[E_{0}\left[\int_{0}^{T}H^{2}_{s}d[M]_{s}+\int_{0}^{T}|H_{s}|\,|dA|_{s}\right]<\infty.\]

## Remarks on semimartingales

The above additive decomposition of a continuous semimartingale into a continuous martingale and a continuous finite variation process is unique.

The quadratic variation of a semimartingale is the quadratic variation of its martingale component: \[[X]_{t}=[M]_{t}.\]

## Stochastic integrals and trading (1)

Assume \((P_{t})_{t\in \mathbb{R}_{+}}\) is a price process modeled as a semimartingale.

Assume \(n\) is piecewise constant and left continuous, with trading dates \((t_{i})_{i \in \mathbb{N}}\) (\(t_{0}=0\)). The value invested at time \(t_{j}\leq t<t_{j+1}\) on the instrument is: \[n_{0}P_{0}+n_{0}(P_{t_{1}}-P_{0})+n_{t_{1}}(P_{t_{2}}-P_{t_{1}})+\cdots+n_{t_{j}}(P_{t}-P_{t_{j}})\] \[\stackrel{\text{def}}{=} n_{0}P_{0}+\int_{0}^{t}n_{u}dP_{u}.\]

## Stochastic integrals and trading (2)

This is precisely the starting point to define the stochastic integral. The key point is that the weight \(n\) predates the change in price. The theory of stochastic integration extends the above definition to general predictable processes \(n\).

Predictable trading processes \(n\) are obtained as limits of piecewise constant left continuous processes.They are idealized objects (real trading is piecewise constant!).

\(\int_{0}^{t}n_{t}dP_{t}\) is the cumulated change in value generated by the trading process.

## Local martingales and integration

Local martingales are almost martingales but not quite! They are martingales when retricted to specific domains of times and outcomes. The proper definition relies on stopping times, i.e. random clock times that are adapted to the filtration. For a process to be a local martingale, it needs to come with a sequence of stopping times which somehow cover the time and event space, and such that the stopped process (for any of these stopping time) is a true martingale.

Integrating a true martingale, one gets a martingale when the resulting quadratic variation is bounded: \(E_{0}\left[\int_{0}^{T}H^{2}_{s}d[M]_{s}\right]<\infty\). When this condition is not met but we instead have \(P\left(\int_{0}^{T}H^{2}_{s}d[M]_{s}<\infty\right)=1\), we get a local martingale instead. Lack of boundedness gets in the way of estabilishing \(N_{t}=E[N_{T}|{\cal F}_{t}]\). Technically, establishing this last condition requires to exchange integration and limits (cf. the dominated convergence theorem of Lebesgue integration).

Illustration with the Saint Petersburg Paradox.

Heuristically, a local martingale fails to be a martingale if its cumulated variance explodes with strictly positive probability.

## Ito’s formula (univariate)

For a process of bounded variation \((A_{t})_{t\in \mathbb{R}_{+}}\) and a continuously differentiable function, one recovers a function from its derivative: \[f(A_{t})-f(A_{0})=\int_{0}^{t}f'(A_{s})dA_{s}.\]

This cannot work for continuous martingales because they have infinite first order variation. Instead, we have for a twice continuously differentiable function: \[f(M_{t})-f(M_{0})=\int_{0}^{t}f'(M_{s})dM_{s}+\frac{1}{2}\int_{0}^{t}f''(M_{s})d[M]_{s}.\]

For a semimartingale \(X_{s}=X_{0}+A_{s}+M_{s}\): \[f(X_{t})-f(X_{0})=\int_{0}^{t}f'(X_{s})dX_{s}+\frac{1}{2}\int_{0}^{t}f''(X_{s})d[X]_{s}.\]

## Ito’s formula (multivariate)

We now have a collection of \(n\) semimartingales \((X_{1,t},\ldots,X_{n,t})\) and a multivariate twice continnuously differentiable function \(f\) into \(\mathbb{R}\). We have: \[ f(X_{1,t},\ldots,X_{n,t})-f(X_{1,0},\ldots,X_{n,0})=\] \[\sum_{i}\int_{0}^{t}f'_{i}(X_{1,s},\ldots,X_{n,s})dX_{i,s}+\] \[\frac{1}{2}\sum_{i,j}\int_{0}^{t}f^{\prime\prime}_{i,j}(X_{1,s},\ldots,X_{n,s})d[X_{i},X_{j}]_{s}.\]

Exercise: write down the formula when \(X_{1,t}=t\). In this case, \(f\) actually only needs to be continuously differentiable in the first variable.

## Product rule

We can apply the above formula to \(f(x,y)=xy\) and two semimartingales \(X\) and \(Y\): \[X_{t}Y_{t}-X_{0}Y_{0}=\int_{0}^{t}X_{u}dY_{u}+\int_{0}^{t}Y_{u}dX_{u}+\int_{0}^{t}d[X,Y]_{u}.\]

If one of the two semimartingales is a finite variation process, we recover: \[X_{t}Y_{t}-X_{0}Y_{0}=\int_{0}^{t}X_{u}dY_{u}+\int_{0}^{t}Y_{u}dX_{u}.\]

## Some remarks

Integral equations are usually written in differential notations, but the latter should be seen as shorthands.

Our finite variation processes will be absolutely continuous. This ensures that they are the integral of their derivatives: \[A_{t}-A_{s}=\int_{s}^{t}a(u)du,\] or in differential notation: \[dA_{u}=a(u)du.\]

## Stochastic Differential Equations (1)

- A homogenous stochastic differential equation driven by a Brownian motion: \[dX_{t}=\mu(X_{t})dt+\sigma(X_{t})dB_{t},\] together with an initial condition \(X_{0}\) (an \({\cal F}_{0}\) measurable random variable). Regularity conditions are imposed on the functions \(\mu(\cdot)\) and \(\sigma(\cdot)\). The question is then the existence of a solution to this equation, i.e. the existence of a process \((X_{t})_{t \in \mathbb{R}_{+}}\) started at \(X_{0}\) and obeying the above equation.

## Stochastic Differential Equations (2)

A homogenous geometric stochastic differential equation driven by a Brownian motion: \[dP_{t}=P_{t}\mu(P_{t})dt+P_{t}\sigma(P_{t})dB_{t}.\]

Apply Ito (assuming \(P\) is strictly positive) with \(f(\cdot)=\log(\cdot)\) to deduce: \[P_{t}=P_{0}\exp\left(\int_{0}^{t}\mu_{u}du-\frac{1}{2}\int_{0}^{t}\sigma_{u}^{2}du+\int_{0}^{t}\sigma_{u}dB_{u}\right).\]

When \(\mu_{t}\) and \(\sigma_{t}\) are deterministic functions of time, the process is log normal.

GBM: \(\mu\) and \(\sigma\) constant.

## GBM

For the GBM\((\mu,\sigma)\) process initialised at \(P_{0}\), the mean of the distribution of \(P_{t}\) as seen from time \(0\) is : \[\exp(\mu t),\] and the median is: \[\exp\left(\mu t-\frac{1}{2}\sigma^{2} t\right).\]

The median and the mean diverge. The conditional distribution gets very skewed, with a few explosive trajectories moving the mean much above the median.

We have: \[\frac{1}{T}\left(\log(P_{T})-\log(P_{0})\right)=\mu-\frac{1}{2}\sigma^{2}+\frac{1}{T}(B_{T}-B_{0}),\] and the law of large numbers ensures that the last term on the right converges to \(0\) as \(T\) goes to infinity.

Thus the mean growth rate converges almost surely to \(\mu-\frac{1}{2}\sigma^{2}\).

## Ornstein Uhlenbeck (1)

Gaussian processes are processes such that all finite dimensional distributions are Gaussian.

A stochastic integral \(\int_{0}^{t}h(u)dB_{u}\) leads to a Gaussian process. Provided \(\int_{-\infty}^{t}h(u)^{2}du<\infty\), one can similarly define the process \(\int_{-\infty}^{t}h(t,u)dB_{u}\) for a deterministic function \(h(t,u)\), which is also Gaussian.

Taking \(h(t,u)=\beta^{\frac{1}{2}}\exp(-\alpha (t-u))\) delivers a covariance stationary Gaussian process which satisfies: \[X_{t}=\exp(-\alpha(t-s))X_{s}+\int_{s}^{t}\beta^{\frac{1}{2}}\exp(-\alpha (t-u))dB_{u}.\]

## Ornstein Uhlenbeck (2)

We can condition the process on \(X_{0}=x\) to get an Ornstein-Uhlenbeck process initialized at \(0\).

It solves the SDE: \[dX_{t}=-\alpha X_{t}dt+\beta^{\frac{1}{2}}dB_{t}\]

This process has mean \(0\) and mean reverting speed \(\alpha\). One can translate it by \(\mu\) to shift its mean as needed.