January 29th, 2023, 8:17 pm

Friends, in this post I want to describe how we can calculate option prices, their delta and gamma at every point on a grid or along every path in monte carlo simulations.

First I describe the related mathematics with equations and then explain how we can embed it in monte carlo simulations or a forward grid.

First we suppose that we are doing monte carlo simulations of an asset according to its stochastic differential equation. This can possibly be a single lognormal/ CEV SDE or asset SDE in a correlated system with stochastic volatility.

Suppose we represent the asset SDE at any intermediate point t in monte carlo simulation by its Z-series representation as

[$]X_t \, = \, a_0 \, + a_1 \, Z_t \, + a_2 \, {Z_t}^2 \, + ...+ a_n \, {Z_t}^n[$]

This would have an equivalent hermite representation as

[$]X_t \, = \, ah_0 \, + ah_1 \,H_1( Z_t) \, + ah_2 \, H_2(Z_t) \, + ...+ ah_n \, H_n(Z_t)[$]

Now we suppose that asset SDE at terminal time related to option maturity is given by its Z-series as

[$]X_T \, = \, b_0 \, + b_1 \, Z_T \, + b_2 \, {Z_T}^2 \, + ...+ b_n \, {Z_T}^n[$]

which will have an equivalent hermite representation as

[$]X_T \, = \, bh_0 \, + bh_1 \,H_1( Z_T) \, + bh_2 \, H_2(Z_T) \, + ...+ bh_n \, H_n(Z_T)[$]

As I have been showing in previous post and also in my paper, we can find the stochastic evolution of SDE between intermediate time t and terminal time T as

[$]X_{t,T} \, = \, bh_0 \,- \, ah_0 + sgn(bh_1 - ah_1) \, \sqrt{sgn(bh_1) \, {bh_1}^2 - sgn(ah_1) \, {ah_1}^2} \,H_1( Z_{t,T}) \, + ...[$]

[$]+ sgn(bh_n - ah_n) \, \sqrt{sgn(bh_n )\, {bh_n}^2 - sgn(ah_n) \, {ah_n}^2} \,H_n( Z_{t,T}) \,[$]

Once we have calculated hermite representation of [$]X_{t,T}[$], we can also find its equivalent Z-series representation as

[$]X_{t,T} \, = \, c_0 \, + c_1 \, Z_{t,T} \, + c_2 \, {Z_{t,T}}^2 \, + ...+ c_n \, {Z_{t,T}}^n[$]

Since [$]X_{T}[$] is sum of [$]X_{t}[$] and [$]X_{t,T}[$], we can write it as

[$]X_T \, = \, X_{t} \, + \, X_{t,T} [$]

which can be written as summation of respective Z-series as

[$]X_T \, = \, a_0 \, + a_1 \, Z_t \, + a_2 \, {Z_t}^2 \, + ...+ a_n \, {Z_t}^n[$]

[$]+\, c_0 \, + c_1 \, Z_{t,T} \, + c_2 \, {Z_{t,T}}^2 \, + ...+ c_n \, {Z_{t,T}}^n[$]

To find the option prices and asset greeks at time [$]X_t[$] at time t, we realize that first line in above equation becomes conditional mean and second line becomes variance of the SDE at time t. So we can also write for a particular realized value of [$]X_t[$] in simulation as

[$]X_T \,|X_t = \,X_t \, +\, c_0 \, + c_1 \, Z_{t,T} \, + c_2 \, {Z_{t,T}}^2 \, + ...+ c_n \, {Z_{t,T}}^n[$]

A call option with strike K can easily be found at time t given the particular value of [$]X_t[$] as

[$]\displaystyle\int_K^{\infty} \, (X_T \, - \, K) \, p(X_T) dX_T [$]

[$]=\displaystyle\int_{Z_K}^{\infty} \, (\,X_t \, +\, c_0 \, + c_1 \, Z_{t,T} \, + c_2 \, {Z_{t,T}}^2 \, + ...+ c_n \, {Z_{t,T}}^n\, - \, K) \, p(Z_{t,T}) dZ_{t,T} [$]

where [$]Z_K[$] is different for every particular value of [$]X_t[$] and can be found from relation ship

[$]\, K \, - \, X_t \, = \, +\, c_0 \, + c_1 \, Z_{K} \, + c_2 \, {Z_{K}}^2 \, + ...+ c_n \, {Z_{K}}^n[$]

so [$] Z_K[$] is particular value of [$]Z_{t,T}[$] that equates [$]X_{t,T} \, = \, K \, - \, X_t \,[$]

Once [$]Z_K[$] has been found, we can convert the equation for call price given previously as

[$]=\displaystyle\int_{Z_K}^{\infty} \, (\,X_t \, +\, c_0 \, + c_1 \, Z_{t,T} \, + c_2 \, {Z_{t,T}}^2 \, + ...+ c_n \, {Z_{t,T}}^n\, - \, K) \, p(Z_{t,T}) dZ_{t,T} [$]

into hermite polynomials and cheaply solve the equation quickly.

This way we can find option prices analytically along any simulation grid or path(More on how to do it in mote carlo setting later).

We can easily extend the technique to find delta and gamma greeks in middle of the simulation. Here is how.

We first write the equation for call option again as

[$]\displaystyle\int_K^{\infty} \, (X_T \, - \, K) \, p(X_T) dX_T [$]

[$]=\displaystyle\int_{Z_K}^{\infty} \, (X_T(Z_t,Z_{t,T}) \, - \, K) \, p(Z_{t,T}) dZ_{t,T} [$]

where in above equation [$]X_T(Z_t,Z_{t,T}) \,[$] is given as

[$]X_T(Z_t,Z_{t,T}) \, = \, a_0 \, + a_1 \, Z_t \, + a_2 \, {Z_t}^2 \, + ...+ a_n \, {Z_t}^n[$]

[$]+\, c_0 \, + c_1 \, Z_{t,T} \, + c_2 \, {Z_{t,T}}^2 \, + ...+ c_n \, {Z_{t,T}}^n[$]

To find delta, we write

[$]\Delta =\frac{d \big[\displaystyle\int_{Z_K}^{\infty} \, (X_T(Z_t,Z_{t,T}) \, - \, K) \, p(Z_{t,T}) dZ_{t,T} \big]}{dX_t}[$]

[$]=\frac{d \big[\displaystyle\int_{Z_K}^{\infty} \, (X_T(Z_t,Z_{t,T}) \, - \, K) \, p(Z_{t,T}) dZ_{t,T} \big]}{dZ_t} \, \frac{dZ_t}{dX_t}[$]

So in order to calculate delta, we have to find the integral

[$]\frac{d \big[\displaystyle\int_{Z_K}^{\infty} \, (X_T(Z_t,Z_{t,T}) \, - \, K) \, p(Z_{t,T}) dZ_{t,T} \big]}{dZ_t} \, [$]

[$]=\displaystyle\int_{Z_K}^{\infty} \, \frac{d \big[X_T(Z_t,Z_{t,T}) \big]}{dZ_t} \, p(Z_{t,T}) dZ_{t,T} \,- \frac{dZ_K}{dZ_t} (X_T(Z_t,Z_K) \, - \, K) \, p(Z_{K}) [$]

For a vanilla call option, the second term of Liebniz integral rule goes to zero since [$](X_T(Z_t,Z_K) \, - \, K)[$] goes to zero because [$]X_T(Z_t,Z_K) \, = \, K[$]

and we are left with solving only the integral below as

[$]\displaystyle\int_{Z_K}^{\infty} \, \frac{d \big[X_T(Z_t,Z_{t,T})]}{dZ_t} \, p(Z_{t,T}) dZ_{t,T} [$]

since

[$]X_T(Z_t,Z_{t,T}) \, = \, a_0 \, + a_1 \, Z_t \, + a_2 \, {Z_t}^2 \, + ...+ a_n \, {Z_t}^n[$]

[$]+\, c_0 \, + c_1 \, Z_{t,T} \, + c_2 \, {Z_{t,T}}^2 \, + ...+ c_n \, {Z_{t,T}}^n[$]

We have

[$]\displaystyle\int_{Z_K}^{\infty} \, \frac{d \big[ (\, a_0 \, + a_1 \, Z_t \, + a_2 \, {Z_t}^2 \, + ...+ a_n \, {Z_t}^n)+\, c_0 \, + c_1 \, Z_{t,T} \, + c_2 \, {Z_{t,T}}^2 \, + ...+ c_n \, {Z_{t,T}}^n \big]}{dZ_t} \, p(Z_{t,T}) dZ_{t,T} [$]

differentiating with respect to [$]Z_t[$] is relevant for the conditional mean only and performing the differentiation, our new equation becomes

[$]\displaystyle\int_{Z_K}^{\infty} \, \big[ \,(a_1 \, +2 a_2 \, Z_t \, + ...+n \, a_n \, {Z_t}^{n-1})+\, c_0 \, + c_1 \, Z_{t,T} \, + c_2 \, {Z_{t,T}}^2 \, + ...+ c_n \, {Z_{t,T}}^n \, \big] \, p(Z_{t,T}) dZ_{t,T} [$]

Above integral can be easily integrated analytically. Again the boundary value of [$]Z_K[$] is found differently for every particular value of [$]X_t[$] from relationship

[$]\, K \, - \, X_t \, = \, +\, c_0 \, + c_1 \, Z_{K} \, + c_2 \, {Z_{K}}^2 \, + ...+ c_n \, {Z_{K}}^n[$]

so [$] Z_K[$] is particular value of [$]Z_{t,T}[$] that equates [$]X_{t,T} \, = \, K \, - \, X_t \,[$]

Calculating the last integral would find the value for delta for call option at a particular point [$]X_t[$] on a simulation grid after substituting it in previous relevant equation.

We can find gamma by repeating the procedure for delta but we might have to include the Liebniz integral rule term in gamma calculations that went to zero for calculations of delta.

An important point for monte carlo simulations is that we can probably do two simulations. In first simulation, we can calculate the Z_series parameters on every time step and also calculate all variances [$]X{t,T}[$]. For monte carlo simulations, it would be convenient to form a uniform grid(or variable grid if you can) and find option prices and deltas on the grid using above procedure. In later simulation, option prices and delta, gammas can be found by interpolation of monte carlo simulated values between the grid points. I did something like this in a different setting in one of recent programs that I posted on Wilmott.

I will try to write a program about it and post it on Wilmott in next few days.

I also have an antipsychotic injection due tomorrow and I may not remain lucid for another 7-10 days after that. I want to request friends again to please protest to American government and defense for forcing innocent people who just want to do science on antipsychotic injections.

You think life is a secret, Life is only love of flying, It has seen many ups and downs, But it likes travel more than the destination. Allama Iqbal