Itō Calculus and Stochastic Differential Equations
by Manuel de Prada Corral
2 min read
Basic notes of Itō calculus applied to stochastic differential equations (SDEs), with code to simulate and filter stochastic processes.
Intro
Itō calculus extends classical calculus to stochastic processes, particularly those driven by Brownian motion. It includes key tools like the Itō integral and Itō's Lemma.
Brownian Motion
Brownian motion is a continuous-time stochastic process with:
- .
- Independent increments.
- Normally distributed increments: .
Itō Integral
The Itō integral of a process with respect to Brownian motion is denoted:
Itō's Lemma
Itō's Lemma is the stochastic counterpart of the chain rule. For a function where follows: Itō's Lemma states:
Solving SDEs with Itō's Lemma
Consider the SDE:
Applying Itō's Lemma to :
Solving this:
Exponentiating both sides:
Implementation
Here's how this is implemented in the context of a particle filter simulation:
import numpy as np
# Parameters
y0 = 1.0
mu = 0.1
sigma = 0.2
T = 1.0
N = 100
M = 1000
dt = T / N
# Placeholder for observations and time
time = np.linspace(0, T, N+1)
true_state = np.exp((mu - 0.5 * sigma**2) * time + sigma * np.random.normal(0, np.sqrt(time)))
# Simulate and plot the true state
import matplotlib.pyplot as plt
plt.figure(figsize=(10, 6))
plt.plot(time, true_state, label='True State')
plt.xlabel('Time')
plt.ylabel('State')
plt.title('True State Evolution Using Itō Calculus')
plt.legend()
plt.show()
In the code:
true_state
is calculated using the derived formula from Itō's Lemma.np.random.normal(0, np.sqrt(time))
simulates the Brownian motion increments. This demonstrates how Itō calculus is applied to model and simulate stochastic processes, providing a powerful toolset for understanding systems influenced by randomness.
TODOs
- Sequential Monte Carlo
- Geometric Brownian motion
- Stochastic differential equations definition
- full demo
- Applications in finance