# Stochastic Calculus

## Sum of Centered Gaussians

Consider the sum of two independent random variables $X$ and $Y$, where each variable is normally distributed with zero mean. Denote the variance of $X$ as $\sigma^{2}_{X}$ and the variance of $Y$ as $\sigma^{2}_{Y}$. $X \sim \mathcal{N}(0, \sigma^{2}_{X}) \quad ; \quad Y \sim \mathcal{N}(0, \sigma^{2}_{Y})$ Recall that the sum of $X$ and $Y$ is distributed with variance $\sigma^{2}_{X} + \sigma^{2}_{Y}$.

$\begin{equation} \label{eqn-1}\tag{1} Z = X + Y \implies Z \sim \mathcal{N}(0, \sigma^{2}_{X} + \sigma^{2}_{Y}) \end{equation}$

## A Continuous Random Walk

Imagine a continuous-time random walk $W(t)$ for which observed differences between $W(t_{i})$ and $W(t_j)$ are always normally distributed with zero mean:

$\begin{equation} \label{eqn-2}\tag{2} W(t_j) - W(t_i) \sim \mathcal{N}(0, \sigma^{2}_{ij}) \end{equation}$

Assume also that the random walk is uncorrelated with itself when comparing non-overlapping time intervals.

Consistency between Eq. (2) and Eq. (1), i.e., $\forall ~ t_{i} < t_{j} < t_{k}, \quad \sigma^{2}_{ij} + \sigma^{2}_{jk} = \sigma^{2}_{ik}$ dictates that $\sigma^{2}_{ij} \propto |t_j - t_i|$ Let us choose to define $W$ such that the constant of proportionality is 1, identifying this random walk as a Wiener process. $W(t_{j}) - W(t_{i}) \sim \mathcal{N}\big(0, |t_{j} - t_{i}|\big)$ For positive, infinitesimal differences in time, we may write

$\begin{equation} \label{eqn-3}\tag{3} {\rm d}W \sim \mathcal{N}(0, {\rm d} t) \end{equation}$

If we consider infinitesimal differences in time and recall that, for any random variable $Z$ ${\rm Var}[Z] \equiv \mathbb{E}[Z^{2}] - \mathbb{E}[Z]^{2}$ For a Wiener process, this implies ${\rm Var}[{\rm d}W] = \mathbb{E}[({\rm d}W)^{2}]$ We may therefore rewrite Eq. (3) in terms of a quadratic variation $\mathbb{E}[({\rm d}W)^{2}] = {\rm d}t$ This observation has an important consequence: First-order approximations in of a process $X(t)$ depending on $W(t)$ must account for the quadratic variation in $W$, where, in expectation,

\begin{equation} \label{eqn-4}\tag{4} \begin{aligned} {\rm d}X(t) &\approx {\frac{{\rm d} X}{{\rm d} t}}{\rm d}t + {\frac{{\rm d} X}{{\rm d} W}}{\rm d}W(t) + \frac{1}{2} {\frac{{\rm d}^{2} X}{{\rm d} W^{2}}} ({\rm d}W(t))^{2} \\ &= \bigg( {\frac{{\rm d} X}{{\rm d} t}} + \frac{1}{2} {\frac{{\rm d}^{2} X}{{\rm d} W^{2}}} \bigg) {\rm d}t + {\frac{{\rm d} X}{{\rm d} W}}{\rm d}W(t) \end{aligned} \end{equation}

## Drift-Diffusion Processes

An Itô drift-diffusion process may be represented in terms of differentials in $t$ and $W$ as ${\rm d}X(t) = \mu_{X}(t){\rm d}t + \sigma_{X}(t) {\rm d}W(t)$ where $\mu_{X}(t)$ and $\sigma_{X}(t)$ are deterministic (e.g., as functions of the process up to time $t$) and $W(t)$ is a Wiener process as described above. Note that $\mu_{X}(t)$ and $\sigma^{2}(t)$ are the mean and variance, respectively, in this example for $\frac{{\rm d}X}{{\rm d} t}$, not for $X$!

### Itô’s Lemma

Twice-differentiable functions applied to drift-diffusion stochastic processes also define drift-diffusion stochastic processes. For example, given a twice-differentiable function $f(t, x)$ where the second argument is given by a stochastic process $X$, ${\rm d}X(t) = \mu_{X}(t){\rm d}t + \sigma_{X}(t) {\rm d}W(t)$ it follows that ${\rm d}f(X) = \mu_{f}(t){\rm d}t + \sigma_{f}(t) {\rm d}W(t)$ where, Taylor expanding $f$ according to Eq. (4) and applying the chain rule twice $\frac{{\rm d}^{2} f}{{\rm d} W^{2}} = \frac{{\rm d}^{2} f}{{\rm d} X^{2}} \bigg(\frac{{\rm d} X}{{\rm d} W}\bigg)^{2} + \frac{{\rm d} f}{{\rm d} X} \frac{{\rm d}^{2} X}{{\rm d} W^{2}}$ yields Itô’s Lemma: $\mu_{f}(t) = {\frac{\partial f}{\partial t}} + {\frac{\partial f}{\partial x}} \mu_{X}(t) + {\frac{1}{2} \frac{\partial^{2} f}{\partial x^{2}}} \sigma^2_{X}(t) \quad ; \quad \sigma_{f}(t) = {\frac{\partial f}{\partial x}} \sigma_{X}(t)$ Importantly, we note that this transformation differs from the classical chain rule: ${\rm d}f = \frac{\partial f}{\partial t} {\rm d}t + \frac{\partial f}{\partial x} {\rm d}X + \underbrace{ \frac{1}{2} \frac{\partial^{2} f}{\partial x^{2}} \bigg(\frac{\partial X}{\partial W} \bigg)^{2} }_{\text{non-classical term}}$

## Geometric Brownian Motion

Consider a stochastic process $X$ for which the proportional growth $\frac{{\rm d}X}{X}$ is an affine transformation of a Wiener process, i.e.,

$\begin{equation} \label{eqn-5}\tag{5} {\rm d}X(t) = X(t) \bigg( \mu{\rm d}t + \sigma {\rm d}W(t) \bigg) \end{equation}$

for constant $\mu$ and $\sigma$.

We provide two means of solving for $X(t)$ :

### By Itô’s Lemma

First, we consider mapping mapping geometric Brownian motion by the function $f = \log x$.

Given ${\rm d}X = (\mu X) {\rm d}t + (\sigma X) {\rm d}W$ We may use Itô’s Lemma to solve for ${\rm d}f$ : ${\rm d}f = \bigg( \frac{\partial f}{\partial x} (\mu X) + \frac{1}{2}\frac{\partial^{2} f}{\partial x^{2}} (\sigma X)^{2} \bigg) {\rm d}t + \frac{\partial f}{ \partial x} (\sigma X) {\rm d}W$ where $\frac{\partial f}{\partial x}\bigg\rvert_{x{=}X} = \frac{1}{X} \quad ; \quad \frac{\partial^{2} f}{\partial x^{2}}\bigg\rvert_{x{=}X} = -\frac{1}{X^{2}}$ Therefore, ${\rm d}f = \bigg( \mu - \frac{1}{2} \sigma^{2} \bigg) {\rm d}t + \sigma {\rm d}W$ This differential equation has solution $f(t) = \bigg(\mu - \frac{1}{2}\sigma^{2}\bigg) t + \sigma W(t) + C$ for constant $C$ determined by boundary conditions (i.e., $X(0)$). Substituting $X(t) = e^{f(t)}$, we conclude $X(t) = X(0) e^{\Big(\mu - \frac{1}{2}\sigma^{2}\Big) t + \sigma W(t)}$

Another approach is to note that both the definition of geometric Brownian motion (Eq. (5)) and a Taylor expansion of $X$ (Eq. (4)) must be consistent.

\begin{align*} {\rm d}X(t) &= X(t) \bigg( \mu{\rm d}t + \sigma {\rm d}W(t) \bigg) \\ {\rm d}X(t) &= \bigg( {\frac{{\rm d} X}{{\rm d} t}} + \frac{1}{2} {\frac{{\rm d}^{2} X}{{\rm d} W^{2}}} \bigg) {\rm d}t + {\frac{{\rm d} X}{{\rm d} W}}{\rm d}W(t) \end{align*}

By the independence of ${\rm d}t$ and ${\rm d}W$, this provides two equations: $\mu X = {\frac{{\rm d} X}{{\rm d} t}} + \frac{1}{2} {\frac{{\rm d}^{2} X}{{\rm d} W^{2}}} \quad ; \quad \sigma X = {\frac{{\rm d} X}{{\rm d} W}}$ From the second equation, we note that $X \propto e^{\sigma W} \quad \text{ and therefore } \quad {\frac{{\rm d}^{2} X}{{\rm d} W^{2}}} = \sigma^{2} X$ Substituting into the first equation, it follows that ${\frac{{\rm d} X}{{\rm d} t}} = \bigg(\mu - \frac{1}{2} \sigma^{2}\bigg) X$ Recognizing an exponential as the solution class for again, for $X(t)$, we arrive at the unique solution $X(t) = X(0) e^{\Big(\mu - \frac{1}{2}\sigma^{2}\Big) t + \sigma W(t)}$

### Properties

Noting that $X(t)$ describes a Galton distribution, it follows that $\mathbb{E}[X_{t}] = X_{0} e^{\mu t} \quad ; \quad {\rm Var}[X_{t}] = (X_{0} e^{\mu t})^{2} \bigg(e^{(\sigma^{2} t)} - 1\bigg)$

### vs Discrete-Time

Imagine investing in a security $X$, the valuation of which (e.g., relative to USD) grows by a ratio $r_{t} \sim \mathcal{N}(\tilde{\mu}, \tilde{\sigma}^{2})$ each month, for constants $\tilde{\mu}$ and $\tilde{\sigma}$.

Should we model the security according to geometric Brownian motion, which applies in the continuous-time limit, or is this inappropriate when changes happen in discrete time?

First, what is the statistical behavior of $X$ after $t$ months when the process evolves discretely? For $X_{t} = X_{0} \prod_{s=0}^{t-1}r_{s} \quad ; \quad r_{s} \sim \mathcal{N}(\tilde{\mu}, \tilde{\sigma}^{2}) \quad \text{(independently)}$ we have $\mathbb{E}[X_{t}] = X_{0} \tilde{\mu}^{t} \quad ; \quad {\rm Var}[X_{t}] = (X_{0} \tilde{\mu}^{t})^{2} \bigg(\Big(\frac{\tilde{\sigma}^{2}}{\tilde{\mu}^{2}} + 1\Big)^{t} - 1 \bigg)$

The statistics of this process agree with those of geometric Brownian motion when we identify $\tilde{\mu} = e^{\mu} \quad ; \quad \frac{\tilde{\sigma}^{2}}{\tilde{\mu}^{2}} = e^{(\sigma^{2})} - 1$