- GuruFinance Insights
- Posts
- Transition Densities and Partial Differential Equations in Quantitative Finance
Transition Densities and Partial Differential Equations in Quantitative Finance
How randomness becomes structure through density functions, stochastic processes, and PDEs
Inventory Software Made Easy—Now $499 Off
Looking for inventory software that’s actually easy to use?
inFlow helps you manage inventory, orders, and shipping—without the hassle.
It includes built-in barcode scanning to facilitate picking, packing, and stock counts. inFlow also integrates seamlessly with Shopify, Amazon, QuickBooks, UPS, and over 90 other apps you already use
93% of users say inFlow is easy to use—and now you can see for yourself.
Try it free and for a limited time, save $499 with code EASY499 when you upgrade.
Free up hours each week—so you can focus more on growing your business.
✅ Hear from real users in our case studies
🚀 Compare plans on our pricing page
🚀 Your Investing Journey Just Got Better: Premium Subscriptions Are Here! 🚀
It’s been 4 months since we launched our premium subscription plans at GuruFinance Insights, and the results have been phenomenal! Now, we’re making it even better for you to take your investing game to the next level. Whether you’re just starting out or you’re a seasoned trader, our updated plans are designed to give you the tools, insights, and support you need to succeed.
Here’s what you’ll get as a premium member:
Exclusive Trading Strategies: Unlock proven methods to maximize your returns.
In-Depth Research Analysis: Stay ahead with insights from the latest market trends.
Ad-Free Experience: Focus on what matters most—your investments.
Monthly AMA Sessions: Get your questions answered by top industry experts.
Coding Tutorials: Learn how to automate your trading strategies like a pro.
Masterclasses & One-on-One Consultations: Elevate your skills with personalized guidance.
Our three tailored plans—Starter Investor, Pro Trader, and Elite Investor—are designed to fit your unique needs and goals. Whether you’re looking for foundational tools or advanced strategies, we’ve got you covered.
Don’t wait any longer to transform your investment strategy. The last 4 months have shown just how powerful these tools can be—now it’s your turn to experience the difference.
Quantitative finance often begins with randomness but ends with structure. That structure takes the form of partial differential equations (PDEs). These equations describe how the probability of future prices evolves. From stochastic processes, we arrive at PDEs. From PDEs, we find solutions that support option pricing, hedging, and risk management.
Taylor Series and the Idea of Local Approximation
Start with a function f(x). To understand its behavior near a point x_0, we can write:

This local approximation allows us to analyze nonlinear behavior by focusing on the first few derivatives. In finance, we apply this idea to value functions, payoff profiles, and density functions. The second-order term becomes essential when modeling variance, which reflects uncertainty.
The Future of AI in Marketing. Your Shortcut to Smarter, Faster Marketing.
This guide distills 10 AI strategies from industry leaders that are transforming marketing.
Learn how HubSpot's engineering team achieved 15-20% productivity gains with AI
Learn how AI-driven emails achieved 94% higher conversion rates
Discover 7 ways to enhance your marketing strategy with AI.

A Taylor Expansion: The second-order expansion shows how we approximate nonlinear functions locally, which underpins the derivation of PDEs in finance.
A Trinomial Random Walk
Before jumping into calculus, return to a discrete model. A simple way to represent price evolution is a trinomial tree. At each time step, the price moves up, down, or stays the same:
Up: S→S⋅u
Down: S→S⋅d
No change: S→S
We assign probabilities p_u, p_d, and p_m. The sum equals 1. This random walk converges to a diffusion process as the step size shrinks. The convergence provides the intuition behind stochastic differential equations.
The key is to track the evolution of probability distributions. That leads us to transition density functions.

Trinomial Random Walk: This simulates discrete price evolution, a precursor to continuous stochastic processes.
Transition Density Functions
Let X(t) be a stochastic process. The transition density p(x,t∣x0,t0) gives the probability density of X(t)=x given that X(t0)=x0. For a Markov process, this density contains all the information needed to understand future states.
The transition density evolves over time. Its dynamics can be expressed using a partial differential equation. That equation comes from the underlying stochastic process.
Our First Stochastic Differential Equation
Consider a basic stochastic differential equation (SDE):

Here, μ is the drift, σ is the diffusion, and W_t is a Wiener process. This equation describes how the state X_t changes over time under uncertainty.
Solving this SDE gives paths. But we often want something stronger: the evolution of the probability density across all possible paths. That brings us to the Fokker-Planck equation.
The Fokker-Planck Equation
The Fokker-Planck equation (also called the forward Kolmogorov equation) describes how the probability density p(x,t) evolves:

This PDE gives the transition density of the process. It shows how the drift and diffusion terms influence the spread of probability over time. You can use it to compute the likelihood of reaching a certain state or to evaluate expected values under uncertainty.

Fokker-Planck Equation: This numerical solution shows how a probability distribution evolves over time under drift and diffusion. The steady-state line reflects the long-run behavior of a mean-reverting process.
Solving PDEs with Similarity Reduction
Some PDEs admit closed-form solutions. Many do not. In those cases, we try to reduce the PDE to a simpler form. Similarity reduction transforms a PDE into an ordinary differential equation (ODE) by changing variables.
For example, suppose a PDE involves u(x,t). We define new variables:

Then we rewrite the PDE in terms of ξ and v. This often collapses the time and space derivatives into a single variable. The technique works best when the PDE has scaling symmetry. Many transition density PDEs — especially those derived from geometric Brownian motion — have this property.
📈 Algorithmic Trading Course — Join the Waitlist
I’m launching a premium online course on algorithmic trading starting July 14. The price is $3000, and spots will be limited.
🔥 What to Expect:
Build trading bots with Python
Backtest strategies with real data
Learn trend-following, mean-reversion, and more
Live execution, portfolio risk management
Bonus: machine learning & crypto trading modules
🎁 Free Bonus:
Everyone who enrolls will get a free e-book:
“100 Trading Strategies in Python” — full of ready-to-use code.
Why This Matters in Finance
Option pricing requires solving PDEs. Risk modeling requires transition densities. Term structure models of interest rates rest on solutions to SDEs. Every modern financial model touches this chain: stochastic process → transition density → PDE → solution.
The most famous application is the Black-Scholes equation. This backward PDE prices a derivative V(S,t) with terminal condition at maturity. The solution involves a transformation that reduces the PDE to the heat equation, then applies a similarity reduction to get a closed-form expression.
That same path — random walk, density, PDE, reduction — applies to many problems in finance. Transition densities describe where a price might go. PDEs describe how that distribution evolves. Solving the PDE gives actionable insights: prices, hedges, or risk measures.
Every stochastic model has an underlying density. That density evolves according to a PDE. Understanding and solving that PDE turns uncertainty into structure. In finance, we do not eliminate randomness. We work with it — through transition densities, differential equations, and boundary conditions.
With each step, the model becomes more precise. From trinomial trees to continuous processes. From random paths to density functions. From density to price.
import numpy as np
import matplotlib.pyplot as plt
# Set up consistent matplotlib style
plt.rcParams.update({
"font.family": "serif",
"axes.spines.top": False,
"axes.spines.right": False
})
# Taylor expansion (2nd order)
def taylor_expand(f, df, d2f, x0, x):
return f(x0) + df(x0) * (x - x0) + 0.5 * d2f(x0) * (x - x0)**2
# Trinomial tree simulation (one step)
def trinomial_step(S, u, d, m, pu, pd, pm):
outcome = np.random.choice([u, m, d], p=[pu, pm, pd])
return S * outcome
# Fokker-Planck for Ornstein-Uhlenbeck
def steady_state_ou(mu, theta, sigma, x_range):
variance = sigma**2 / (2 * theta)
return (1 / np.sqrt(2 * np.pi * variance)) * np.exp(-(x_range - mu)**2 / (2 * variance))
# Discretized Fokker-Planck evolution
def fokker_planck_evolution(mu, sigma, x, t, dx, dt, steps):
p = np.exp(-x**2) # Initial guess
p /= np.sum(p) * dx
for _ in range(steps):
dpdx = np.gradient(p, dx)
d2pdx2 = np.gradient(dpdx, dx)
drift_term = -mu * dpdx
diffusion_term = 0.5 * sigma**2 * d2pdx2
p += dt * (drift_term + diffusion_term)
p = np.maximum(p, 0)
p /= np.sum(p) * dx # Renormalize
return p
# Define function and derivatives for Taylor expansion
f = np.sin
df = np.cos
d2f = lambda x: -np.sin(x)
x0 = 0
x_vals = np.linspace(-2, 2, 200)
approx = taylor_expand(f, df, d2f, x0, x_vals)
plt.figure(figsize=(10, 4))
plt.plot(x_vals, f(x_vals), label="f(x) = sin(x)")
plt.plot(x_vals, approx, label="2nd-order Taylor Expansion", linestyle='--')
plt.title("Taylor Series Expansion")
plt.xlabel("x")
plt.ylabel("f(x)")
plt.grid(False)
plt.savefig("taylor_series.png")
plt.show()
# Simulate one path of trinomial tree
S = 100
u, d, m = 1.1, 0.9, 1.0
pu, pd, pm = 0.3, 0.3, 0.4
steps = 100
prices = [S]
for _ in range(steps):
S = trinomial_step(S, u, d, m, pu, pd, pm)
prices.append(S)
plt.figure(figsize=(10, 4))
plt.plot(prices, label="Trinomial Random Walk")
plt.xlabel("Step")
plt.ylabel("Price")
plt.title("Simulated Trinomial Price Walk")
plt.grid(False)
plt.savefig("trinomial_walk.png")
plt.show()
# Fokker-Planck approximation for Gaussian diffusion
x = np.linspace(-5, 5, 500)
dx = x[1] - x[0]
dt = 0.001
p = fokker_planck_evolution(mu=0.0, sigma=1.0, x=x, t=0, dx=dx, dt=dt, steps=100)
plt.figure(figsize=(10, 4))
plt.plot(x, p, label="Approx. Transition Density")
plt.plot(x, steady_state_ou(0, 1, 1, x), label="Steady State (Ornstein-Uhlenbeck)", linestyle='--')
plt.title("Fokker-Planck Evolution and Steady State")
plt.xlabel("x")
plt.ylabel("Probability Density")
plt.grid(False)
plt.savefig("fokker_planck.png")
plt.show()