# Code for Simulation of SDEs using Girsanov Theorem

• ahsanamin
In summary, the paper discusses methods for generating transition probabilities for mean reverting stochastic differential equations and simulating the mean reverting SDE using these transition probabilities. It also covers the use of Girsanov theorem to add or remove drift from the noise in the simulation. The code for the method is available for download from the author's website.
ahsanamin
http://wilmott.com/i/dominant/block.gif
I have worked with generation of transition probabilities of mean reverting CEV type stochastic differential equations using Girsanov theorem. A variable grid is generated and Transition probabilities are calculated from the well known analytic distribution(CDF) of the CEV noise stochastic differential equation. Various conditional integrals representing noise and variance of the Girsanov exponential are calculated along the grid. The initial CEV transition probabilities are transformed by the conditional values of Girsanov exponential to give the transition probabilities of the CEV type mean reverting stochastic differential equations. These transition probabilities are used by the program to simulate the mean reverting SDE. Many times it will be difficult to numerically solve the problem on such a general grid using the partial differential equation techniques. The method is very general and can be used for precision simulation of other SDEs with more complex dynamics than mean reverting SDEs.

It is natural to use Girsanov on a grid that has no monte carlo like simulation noise that drastically affects the performance of measure related methods in a monte carlo setting.

The paper is not ready yet and will be posted on SSRN in a few days. The experimental code can be downloaded from http://www.infinitiderivatives.com. You have to go to New Technologies page and the link to code can be found at the bottom of the text.

The code only deals with generation of transition probabilities and simulation of the mean reverting SDE but the scope of the paper is wider and will cover other aspects of option pricing so it will take a bit more time.

Greg, I will be posting my paper on SSRN in about a week to ten days. Paper covers several other aspects of stochastic processes so it requires a bit more work. I received a private message from Orodruin about removal of the other 2nd post saying that it was unsubstantiated with a published paper. I did not respond since I did not want to argue even though my paper had more than 1250 downloads on SSRN. That post was also distributing a code that was even more valuable for scientific research community. These codes are meant to contribute to the scientific community working with stochastic processes and are proven to work. If you have any special request about rewording the post, I will certainly like to do that.

For those who downloaded the code, I will try to give some explanation of the code. It simulates the density of mean reverting stochastic differential equations given by the equation
dV(t)=kappa*(theta-V(t)) dt+ epsilon * V(t)^beta * dz(t)
I generate the density of (driftless) noise dY(t)=epsilon * Y(t)^beta * dz(t) analytically using chi-squared density formulas. The drift is added to the noise using Girsanov theorem. Girsanov theorem is a change of measure that adds or removes drift from a stochastic differential equation. In our case the density of V(t) and Y(t) are related by their radon nikodym derivative (Girsanov exponential). I will not go into details of Girsanov which are standard but for the particular SDE, the Girsanov exponential takes the form
Exp[-.5*( (kappa*(theta-V(t)))/(epsilon*V(t)^beta))^2 *dt) + (kappa*(theta-V(t)))/(epsilon*V(t)^beta)) *dz(t)]
For a small time step size as we require for generation of transition probabilities, expected values of these integrals in the exponential can be evaluated with good precision with their approximate variances. Since for small time step size conditional diffusions remains normal, we can use the formula for expected value of lognormal in terms of the mean and variances of the underlying normal to find the conditional value of Girsanov exponetial(radon nikodym derivative) on every point on the Grid and we can retrieve the density of SDE with drift using radon nikodym derivative between two measures and the knowledge of the analytical chi-square density of noise without drift. The method works well and can be used for precision simulation of densities of stochastic differential equations other than just mean reverting SDEs.

## 1. What is the Girsanov Theorem and how is it used in SDE simulations?

The Girsanov Theorem is a mathematical result that describes the relationship between two different probability measures. In the context of SDE simulations, it is used to transform the original probability measure of a stochastic process to a new measure, under which the process becomes a martingale. This is useful because it simplifies the simulation of the SDE, making it more efficient and accurate.

## 2. What are the main advantages of using the Girsanov Theorem in SDE simulations?

The use of the Girsanov Theorem in SDE simulations has several advantages. Firstly, it allows for a more accurate and efficient simulation of the SDE, as mentioned earlier. Additionally, it allows for the simulation of more complex SDEs that would be difficult or impossible to simulate using other methods. It also provides a framework for incorporating different types of drift and diffusion terms into the simulation, making it more versatile.

## 3. Are there any limitations to using the Girsanov Theorem in SDE simulations?

While the Girsanov Theorem is a powerful tool for SDE simulations, it does have some limitations. One limitation is that it requires the drift and diffusion terms of the SDE to be known explicitly, which may not always be the case. Additionally, it assumes that the process is continuous and differentiable, which may not always be true in real-world applications.

## 4. How does the Girsanov Theorem relate to other methods for simulating SDEs?

The Girsanov Theorem is closely related to other methods for simulating SDEs, such as the Euler-Maruyama method and the Milstein method. In fact, both of these methods can be seen as special cases of the Girsanov Theorem, where the drift and diffusion terms are simplified. The Girsanov Theorem provides a more general framework that encompasses these methods and allows for more complex SDEs to be simulated.

## 5. Are there any practical applications of using the Girsanov Theorem in SDE simulations?

Yes, the Girsanov Theorem has many practical applications in areas such as finance, physics, and engineering. It is often used in financial modeling to simulate stock price movements and to price options. In physics, it can be used to model the behavior of particles in a fluid. In engineering, it can be used to simulate the behavior of a system under uncertainty. Overall, the Girsanov Theorem is a useful tool for simulating and analyzing a wide range of real-world processes.

• Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
• MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
Replies
6
Views
1K
• Classical Physics
Replies
0
Views
98
• Calculus and Beyond Homework Help
Replies
3
Views
2K
• Atomic and Condensed Matter
Replies
1
Views
2K
Replies
41
Views
4K
• Set Theory, Logic, Probability, Statistics
Replies
4
Views
2K
• Mechanical Engineering
Replies
2
Views
1K