June 8th, 2022, 10:15 am
In this post I want to share my analytics for stochastic dt-integral of mean-reverting SDEs. A typical mean reverting SDE is of the form.
[$]dV(t) \, = \kappa \, (\theta \, - \, V(t) \,) dt + \, \sigma \, {V(t)}^{\gamma} \, dZ(t)\,[$]
We want to find the value of [$]\int_0^t \, V(s) \,ds[$] and later find step values of that integral over each time period given as [$]\int_{t_0}^{t_1} \, V(s) \,ds[$] and [$]\int_{t_1}^{t_2} \, V(s) \,ds[$] and [$]\int_{t_2}^{t_3} \, V(s) \,ds[$] and so on.
We first solve for the SDE(for different times) like we have usual treatment of classic mean-reverting SDEs. This gives us
[$]V(t_1)\, = \exp(- \, \kappa t_1) V(t_0) + \theta \, (1-\exp(- \, \kappa t_1)) +\, \exp(- \, \kappa t_1) \int_{t_0}^{t_1} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,[$]
for [$]V(t_2)\,[$] we have
[$]V(t_2)\, = \exp(- \, \kappa t_2) V(t_0) + \theta \, (1-\exp(- \, \kappa t_2)) +\, \exp(- \, \kappa t_2) \int_{t_0}^{t_2} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,[$]
[$] = \exp(- \, \kappa t_2) V(t_0) + \theta \, (1-\exp(- \, \kappa t_2)) +\, \exp(- \, \kappa t_2) \int_{t_0}^{t_1} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,+\, \exp(- \, \kappa t_2) \int_{t_1}^{t_2} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,[$]
In above, We have split the integral into orthogonal parts as
[$] \int_{t_0}^{t_2} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,=\,\int_{t_0}^{t_1} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,+ \int_{t_1}^{t_2} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,[$]
Similarly at date [$]t_3[$] our solution to V(t) is given as
[$]V(t_3) = \exp(- \, \kappa t_3) V(t_0) + \theta \, (1-\exp(- \, \kappa t_3)) +\, \exp(- \, \kappa t_3) \int_{t_0}^{t_1} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,[$]
[$]+\, \exp(- \, \kappa t_3) \int_{t_1}^{t_2} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,+\, \exp(- \, \kappa t_3) \int_{t_2}^{t_3} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,[$]
Now trying to approximate the dt-integral over first three time steps, we get
[$]\int_{t_0}^{t_3} \, V(t) \, dt\, = \big[ \, V(t_1) \, + \, V(t_2) \,+\, V(t_3) \, \big] \Delta t[$]
[$]=\Big[ \big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) +\exp(- \, \kappa t_3) ) \big] V(t_0) +\big[ (1-\exp(- \, \kappa t_1)) + (1-\exp(- \, \kappa t_2)) + (1-\exp(- \, \kappa t_3)) \big] \theta [$]
[$]+\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) +\exp(- \, \kappa t_3) ) \big] \,\int_{t_0}^{t_1} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,[$]
[$]+\big[ (\exp(- \, \kappa t_2) +\exp(- \, \kappa t_3) ) \big] \,\int_{t_1}^{t_2} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,[$]
[$]+\big[ (\exp(- \, \kappa t_3) ) \big] \,\int_{t_2}^{t_3} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\, \Big] \, \Delta t[$]
We can represent the stochastic integrals in above equation in hermite polynomial basis since they are already in the form of Z-series (We just take first three hermite polynomials in our analysis for brevity) , this gives us
[$]\,\int_{t_0}^{t_1} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,=a_{11} H_1(t_1) \, +a_{12} H_2(t_1) +\,a_{13} H_3(t_1) \, + ...[$]
[$]\,\int_{t_1}^{t_2} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,=a_{21} H_1(t_2) \, +a_{22} H_2(t_2) +\,a_{23} H_3(t_2) \, + ...[$]
[$]\,\int_{t_2}^{t_3} \, \exp( \, \kappa t)\sigma {V(t)}^{\gamma} \, dZ(t)\,=a_{31} H_1(t_3) \, +a_{32} H_2(t_3) +\,a_{33} H_3(t_3) \, + ...[$]
Inserting above hermite representation in the approximate dt-integral, we get
[$]\int_{t_0}^{t_3} \, V(t) \, dt\, = \big[ \, V(t_1) \, + \, V(t_2) \,+\, V(t_3) \, \big] \Delta t[$]
[$]=\Big[ \big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) +\exp(- \, \kappa t_3) ) \big] V(t_0) +\big[ (1-\exp(- \, \kappa t_1)) + (1-\exp(- \, \kappa t_2)) + (1-\exp(- \, \kappa t_3)) \big] \theta [$]
[$]+\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) +\exp(- \, \kappa t_3) ) \big] \,\big[a_{11} H_1(t_1) \, +a_{12} H_2(t_1) +\,a_{13} H_3(t_1) \, + ...\big]\,[$]
[$]+\big[ (\exp(- \, \kappa t_2) +\exp(- \, \kappa t_3) ) \big] \,\,\big[a_{21} H_1(t_2) \, +a_{22} H_2(t_2) +\,a_{23} H_3(t_2) \, + ...\big]\,[$]
[$]+\big[ (\exp(- \, \kappa t_3) ) \big] \,\,\big[a_{31} H_1(t_3) \, +a_{32} H_2(t_3) +\,a_{33} H_3(t_3) \, + ...\big]\, \Big] \, \Delta t[$]
This gives us variance of dt-integral for first three time steps as
[$]Var \Big[\int_{t_0}^{t_3} \, V(t) \, dt\, \Big][$]
[$]=\Big[{\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) +\exp(- \, \kappa t_3) ) \big] }^2 \, {a_{11}}^2 Var\big[H_1(t_1)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) +\exp(- \, \kappa t_3) ) \big] }^2 \, {a_{12}}^2 Var\big[H_2(t_1)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) +\exp(- \, \kappa t_3) ) \big] }^2 \, {a_{13}}^2 Var\big[H_3(t_1)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_2) +\exp(- \, \kappa t_3) ) \big] }^2 \, {a_{21}}^2 Var\big[H_1(t_2)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_2) +\exp(- \, \kappa t_3) ) \big] }^2 \, {a_{22}}^2 Var\big[H_2(t_2)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_2) +\exp(- \, \kappa t_3) ) \big] }^2 \, {a_{23}}^2 Var\big[H_3(t_2)\big][$]
[$]+{\big[ \exp(- \, \kappa t_3) \big] }^2 \, {a_{31}}^2 Var\big[H_1(t_3)\big][$]
[$]+{\big[ \exp(- \, \kappa t_3) \big] }^2 \, {a_{32}}^2 Var\big[H_2(t_3)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_3) \big] }^2 \, {a_{33}}^2 Var\big[H_3(t_3)\big]\, \Big] {\Delta t}^2[$]
Since we want to match variances on every step, we have to calculate the above variances on every time step. On second time step the variances would be
[$]Var \Big[\int_{t_0}^{t_2} \, V(t) \, dt\, \Big][$]
[$]=\Big[{\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) ) \big] }^2 \, {a_{11}}^2 Var\big[H_1(t_1)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) ) \big] }^2 \, {a_{12}}^2 Var\big[H_2(t_1)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) ) \big] }^2 \, {a_{13}}^2 Var\big[H_3(t_1)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_2) ) \big] }^2 \, {a_{21}}^2 Var\big[H_1(t_2)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_2) ) \big] }^2 \, {a_{22}}^2 Var\big[H_2(t_2)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_2) ) \big] }^2 \, {a_{23}}^2 Var\big[H_3(t_2)\big] \Big] {\Delta t}^2[$]
Similarly variance of stochastic integral for first time step is given as
[$]Var \Big[\int_{t_0}^{t_1} \, V(t) \, dt\, \Big][$]
[$]=\Big[{\big[ (\exp(- \, \kappa t_1) ) \big] }^2 \, {a_{11}}^2 Var\big[H_1(t_1)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_1) ) \big] }^2 \, {a_{12}}^2 Var\big[H_2(t_1)\big][$]
[$]+{\big[ (\exp(- \, \kappa t_1) ) \big] }^2 \, {a_{13}}^2 Var\big[H_3(t_1)\big] \Big] {\Delta t}^2[$]
Now we want to find coefficients of hermite representation so that on each step, total variance of each hermite polynomial matches with the variance of stochastic dt-integral at that step.
On the first step of the integral from [$]t_0[$] to [$] t_1[$] , there are no calculations and
[$] \Big[\int_{t_0}^{t_1} \, V(t) \, dt\, \Big][$]
[$]=c_1(t_1) \, H_1\,+ \,c_2(t_1) \, H_2\, + \, c_3(t_1) \, H_3\, [$]
where
[$]c_1(t_1) \,= \exp(- \, \kappa t_1) \, a_{11} \, \Delta t[$]
[$]c_2(t_1) \,= \exp(- \, \kappa t_1) \, a_{12} \, \Delta t[$]
[$]c_3(t_1) \,= \exp(- \, \kappa t_1) \, a_{13} \, \Delta t[$]
On second step, we have for one step addition that hermite coefficients are chosen so that total variance of dt-integral after second step given our hermite coefficients on previous step match with total variance after second step. We match coefficients of first hermite polynomial with cumulative variance of first hermite polynomial in the equations below. For that we have
[$]{\big[ c_1(t_1) \, + \, c_1(t_2) \, \big] }^2 = \Big[ \, {\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) ) \big] }^2 \, {a_{11}}^2+{\big[ (\exp(- \, \kappa t_2) ) \big] }^2 \, {a_{21}}^2 \Big] \, {\Delta t}^2[$]
(The reason to add [$]c_1(t_1)[$] and [$]c_1(t_2)[$] linearly inside the square is that our hermite polynomials are perfectly correlated across time and there is no way to maintain orthogonality over time as in monte carlo.)
which gives us
[$]\, c_1(t_2) \, = \Big[\,\sqrt{ {\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) ) \big] }^2 \, {a_{11}}^2+{\big[ (\exp(- \, \kappa t_2) ) \big] }^2 \, {a_{21}}^2}\,- \exp(- \, \kappa t_1) \, a_{11} \Big] \, \Delta t[$]
Similarly value of step coefficient of second hermite would be
[$]\, c_2(t_2) \, = \Big[ \,\sqrt{ {\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) ) \big] }^2 \, {a_{12}}^2+{\big[ (\exp(- \, \kappa t_2) ) \big] }^2 \, {a_{22}}^2}\,- \exp(- \, \kappa t_1) \, a_{12}\Big] \, \Delta t [$]
The value of step coefficients of third hermite would be
[$]\, c_3(t_2) \, = \Big[ \,\sqrt{ {\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) ) \big] }^2 \, {a_{13}}^2+{\big[ (\exp(- \, \kappa t_2) ) \big] }^2 \, {a_{23}}^2}\,- \exp(- \, \kappa t_1) \, a_{13}\Big] \, \Delta t [$]
With above values our hermite representation of second step of the integral would be
[$] \Big[\int_{t_1}^{t_2} \, V(t) \, dt\, \Big][$]
[$]=c_1(t_2) \, H_1\,+ \,c_2(t_2) \, H_2\, + \, c_3(t_2) \, H_3\, [$]
Similarly hermite coefficient for third time step [$]\, c_1(t_3) \,[$] should be that when it is added to coefficients of first two steps, the total variance equals the variance of dt-integral after third step. We match cumulative variance of first hermite polynomial over first three time steps with coefficients of first hermite polynomial over three time steps.
[$]{\big[ c_1(t_1) \, + \, c_1(t_2) \,\, + \, c_1(t_3) \, \big] }^2 = \Big[\, {\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2)+ \exp(- \, \kappa t_3) ) \big] }^2 \, {a_{11}}^2[$]
[$]+{\big[ (\exp(- \, \kappa t_2) + \exp(- \, \kappa t_3)) \big] }^2 \, {a_{21}}^2 + \big[\exp(- \, \kappa t_3) \, \big] \, {a_{31}}^2 \Big] \, {\Delta t}^2[$]
Solving for [$]\, c_1(t_3) \,[$], we get one step value of the first hermite coefficient as
[$]\, c_1(t_3) \, = \Big[ \, \sqrt{\big[ {\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2)+ \exp(- \, \kappa t_3) ) \big] }^2 \, {a_{11}}^2+{\big[ (\exp(- \, \kappa t_2) + \exp(- \, \kappa t_3)) \big] }^2 \, {a_{21}}^2 + \big[\exp(- \, \kappa t_3) \, \big] \, {a_{31}}^2 \big] } \, [$]
[$]- \,\sqrt{ {\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) ) \big] }^2 \, {a_{11}}^2+{\big[ (\exp(- \, \kappa t_2) ) \big] }^2 \, {a_{21}}^2}\, \Big] \, \Delta t[$]
Similarly we can calculate value of step coefficients of second hermite as
[$]\, c_2(t_3) \, =\Big[ \, \sqrt{\big[ {\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2)+ \exp(- \, \kappa t_3) ) \big] }^2 \, {a_{12}}^2+{\big[ (\exp(- \, \kappa t_2) + \exp(- \, \kappa t_3)) \big] }^2 \, {a_{22}}^2 + \big[\exp(- \, \kappa t_3) \, \big] \, {a_{32}}^2 \big] } \, [$]
[$]- \,\sqrt{ {\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) ) \big] }^2 \, {a_{12}}^2+{\big[ (\exp(- \, \kappa t_2) ) \big] }^2 \, {a_{22}}^2}\, \Big] \, \Delta t[$]
and
[$]\, c_3(t_3) \, =\Big[\, \sqrt{\big[ {\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2)+ \exp(- \, \kappa t_3) ) \big] }^2 \, {a_{13}}^2+{\big[ (\exp(- \, \kappa t_2) + \exp(- \, \kappa t_3)) \big] }^2 \, {a_{23}}^2 + \big[\exp(- \, \kappa t_3) \, \big] \, {a_{33}}^2 \big] } \, [$]
[$]- \,\sqrt{ {\big[ (\exp(- \, \kappa t_1) + \exp(- \, \kappa t_2) ) \big] }^2 \, {a_{13}}^2+{\big[ (\exp(- \, \kappa t_2) ) \big] }^2 \, {a_{23}}^2}\, \, \Big] \, \Delta t[$]
With above values our hermite representation of third step of the integral would be
[$] \Big[\int_{t_2}^{t_3} \, V(t) \, dt\, \Big][$]
[$]=c_1(t_3) \, H_1\,+ \,c_2(t_3) \, H_2\, + \, c_3(t_3) \, H_3\, [$]
It turns out that coefficients on each hermite polynomial for one particular step of the stochastic time integral would be square root of the total variance of that particular hermite polynomial at the end of the time interval minus square root of the total variance of that particular hermite at the start of the time interval for a given dt-integral.
This is how I did the calculation of value of stochastic time integral over each step in the program.
I still have to discuss how to calculate the values of orthogonal hermite coefficients on each time step like [$] a_{11} \, , a_{21} \, ,a_{31} [$] for first hermite polynomial and [$] a_{12} \, , a_{22} \, ,a_{32} [$] for second hermite polynomial and so on.
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