Girsanov Change of Measure: Why Radon–Nikodym Weights Do Not Fix Paths
Summary
The document examines a Monte Carlo attempt to remove the drift from geometric Brownian motion by multiplying each simulated price path by a Radon–Nikodym derivative. Its central explanation is that this derivative changes the probability weights assigned to paths; it does not transform each plotted path into a driftless trajectory. Under a change of measure, expectations are reweighted, rather than individual outcomes being corrected into new sample paths.
The response says the stated likelihood ratio is implemented consistently and recommends checking a weighted Monte Carlo expectation against the risk neutral theoretical expectation. It also distinguishes the weighted process from a Brownian motion: multiplying a process by a likelihood ratio does not generally give it Brownian path properties. The explanation is conceptual and does not provide a complete code correction; the stated expectation check also needs careful interpretation of the time horizon and discounting.
Key ideas
- A Radon–Nikodym derivative reweights path probabilities to implement a change of measure.
- Multiplying each simulated price path by its likelihood ratio does not remove its drift path by path.
- Weighted Monte Carlo expectations can be checked against expectations under the target measure.
- The product of a process and its likelihood ratio is not generally a Brownian motion.
Tags
Full text
# Girsanov Theorem: how to implement it with code?
# Girsanov Theorem: how to implement it with code?
I'm trying to visualize the path transformations coming from the application of the Girsanov Theorem in a Monte Carlo Simulation.
Below the (Python) code where I'm trying to "adjust" the drifted paths by introducing the Radon-Nikodym derivative to correct them. This is "L" in the code. Unfortunately I am not able to remove the drift in the correct way.
In formula, assuming a Geometric Brownian motion for the stock price with drift $\mu$ and volatility $\sigma$, given $z_i$ as a realization from a standard normal, $S_t$ the stock price at time $t$, for every Monte Carlo Simulation where there are $t$ discrete steps, I am doing:
- $S_t= S_0\prod_{i=0}^{t}\exp^{(\mu-\frac{1}{2}\sigma^2)\Delta t + \sqrt{\Delta t}\sigma z_i}$
- $L_t=\prod_{i=0}^{t}\exp^{-\frac{1}{2}\theta^2\Delta t - \theta\sqrt(\Delta t) z_i}$
- the "adjusted" path is $\tilde S_t = S_t L_t$
where $\theta = \mu/\sigma$ assuming zero as the risk-free rate.
Is the Radon-Nikodym derivative correct? Have I misunderstood the theorem's application?
```
import numpy as np
import pandas as pd
rng = np.random.default_rng()
# Sim pars
mu=.4
sigma=.15
rf=0
dt=1/252
B = 100 # simulations
T = 100 # steps ahead
z = rng.normal(size = B*T)
z = z.reshape(T,B)
# Each of the B columns will be a path
sims = pd.DataFrame(data=z)
names = ['b' + str(a) for a in np.arange(0,B)]
sims.columns = names
# Girsanov corrected paths
def f_girsanov(z, mu, sigma, rf, dt):
theta = (mu-rf)/sigma
L = np.exp(-.5*theta**2*dt - theta*np.sqrt(dt)*z) # Radon-Nikodym Derivative
out = L * np.exp((mu-.5*sigma**2)*dt+sigma*np.sqrt(dt)*z)
return out
# Each column of sims contains the shocks of a T-step path. I correct them
# according to Girsanov
girsanovs = sims.apply(f_girsanov, axis=1, mu=mu, sigma=sigma, rf=0, dt=dt)
girsanovs = pd.DataFrame(girsanovs)
# "Rolling" path calculation: each column is a corrected path
out3 = girsanovs.expanding().apply(lambda s: np.exp(sum(np.log(s))))
# Clearly something is not working with the correction
plt.plot(out3.iloc[:,a], color="blue", alpha=.1)
plt.show()
```
Thanks for the help. Let me know if more details are needed.
Reference: Ch. 5 of Stochastic Calculus for Finance II by S. Shreve.
## Answer by Enrico (score 2, accepted)
https://quant.stackexchange.com/a/83976
From what I understood in the comments:
- The Radon-Nikodym derivative is correctly implemented in the formulas and in the code. As a check one could take the Monte Carlo expectaction of the last row of the output matrix (out3) and see that is close to the theoretical value under the risk-neutral measure. This is $e^{r_f+0.5\sigma^2}$ since the price is log-normally distributed ($r_f$ is the risk-free rate).
- An adjusted path $\tilde S$ won't be driftless on a chart. In fact, the Radon-Nikodym derivative is only changing the "$P$-weight" given to the $\omega\in\Omega$ of the probability space $(\Omega,\mathcal{F},P)$ to obtain the same expectations taken under the risk-neutral measure $\tilde P$.
## Answer by Rylan (score 2)
https://quant.stackexchange.com/a/84026
Your answer has the key points, but here's another angle to look at Girsanov/the Radon Nikodym derivative. (I'll be speaking loosely here so let me know if something isn't clear or precise enough and I'll try to clarify it.)
One very direct way to "construct" a Brownian motion with drift is to take a Brownian motion without drift, and add a drift term.
Another way, much less direct, is to take a Brownian motion without drift, but (loosely speaking) change the probability you apply to each path. For example, if you want to add a positive drift, you make paths that are going up more likely, and paths that are going down less likely.
Intuitively, this works because if we observe a few paths of a Brownian motion (with or without drift) we can't know for sure what the drift is. A path of $X_t$ where $dX_t = dW_t + dt$ could also have been generated by $Y_t$ where $dY_t = dW_t - dt$, although that path is "more likely" to have been generated by $X$ and less likely to have been generated by $Y$.
Let's call our "real-world" measure $\mathbb{P}$. Girsanov, as stated by Shreve, basically gives us the Radon-Nikodym derivative $Z_t$ that defines a new measure $\mathbb{Q}$. Under $\mathbb{P}$, we have a process $\tilde W_t = W_t + \int_0^t\Theta(t)dt$, which we recognize as a Brownian motion with drift. Under $\mathbb{Q}$, we effectively "reassess" the probability of every path, so that $\tilde W_t$ is a brownian motion under $\mathbb{Q}$.
A point worth noting is that you appear to be computing something similar to $Z_t\tilde W_t$ . By the properties of the Radon Nikodym derivative, this is a martingale under $\mathbb{P}$, but it is not generally a Brownian motion (or a Brownian motion with drift) under $\mathbb{P}$, as it does not accumulate quadratic covariance at one per unit time. So effectively you're not "correcting" the path so much as implictly "weighting" it, so that when you average those paths you get a martingale.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.