February 23rd, 2021, 7:16 pm
In this post, I want to write how to calculate exact Gaussian transition CDF, Gaussian transition probability and derivatives of Gaussian transition probability from mth Bessel grid cell [$]B_m[$] at time t, to any point on the new grid at time t. Please note that we are not calculating Gaussian CDF and transition probability merely between two points. Rather we have an initial Bessel grid where we take an arbitrary mth cell and we want to calculate exact mass transfer CDF, transition probability and its derivatives from the entire mth cell at time t to nth cell at time t+1. As I indicated in my previous post there is an obvious difference between mass transfer(its CDF and pdf) between two points and mass transfer from a cell of certain width to another point and both of these are different and replacing mass transfer between a cell and a point by mass transfer between two points can lead to increasing accuracies in any transition probabilities algorithm.
Let us fix the notation first which is slightly different from what I have been using earlier. We have a Bessel grid and we indicate an arbitrary cell by [$]B_m[$] and the center of this cell is given by [$]B_{m0}[$]. This center [$]B_{m0}[$] will correspond to point [$]Z_m[$] on Z-grid and in general both boundaries of the cell(that will correspond to [$]Z_m+\Delta Z/2[$] and [$]Z_m-\Delta Z/2[$]) will not be equidistant from this center of the cell [$]B_{m0}[$]. We will represent the left boundary of cell [$]B_m[$] corresponding to [$]Z_m-\Delta Z/2[$] as [$]B_{m1}[$] and right boundary corresponding to [$]Z_m+\Delta Z/2[$] as [$]B_{m2}[$]
The transition probability between center of mth cell [$]B_{m0}[$] to arbitary point [$]B_n[$] on next grid is denoted as [$] p_{m0,n}=N(B_n-B_{m0},0,\sigma_m)[$].
Its CDF is defined by uppercase of PDF as [$] P_{m0,n}=\int_{-\infty}^{(B_n-B_{m0})} N(B_n-B_{m0},0,\sigma_m) dN [$]
I want to emphasize that above PDF, CDF and their derivatives below are between two points(The centre of [$]B_m[$] given by [$]B_{m0}[$] and point [$]B_n[$]
First derivative of this transition probability [$]p_{m0,n}[$] at point [$]B_{m0}[$] is given as[$]\frac{dp_{m0,n}}{dB}=(-1) \frac{-1}{\sigma_m} \frac{(B_n-B_{m0})}{\sigma_m} N(B_n-B_{m0},0,\sigma_m)[$]
Second derivative of this transition probability [$]p_{m0,n}[$] at point [$]B_{m0}[$] is given as[$]\frac{d^2p_{m0,n}}{d{B}^2}=\frac{(-1)^2}{{(\sigma_m)}^2} ({(\frac{(B_n-B_{m0})}{\sigma_m})}^2-1) N(B_n-B_{m0},0,\sigma_m)[$]
Third derivative of this transition probability [$]p_{m0,n}[$] at point [$]B_{m0}[$] is given as[$]\frac{d^3p_{m0,n}}{d{B}^3}=(-1)*\frac{(-1)^3}{{(\sigma_m)}^3} ({(\frac{(B_n-B_{m0})}{\sigma_m})}^3-3(\frac{(B_n-B_{m0})}{\sigma_m})) N(B_n-B_{m0},0,\sigma_m)[$]
We define the probability density function at center of mth cell in Bessel variable [$]B_m[$] as lowercase [$]p_{m0}=p(Z_m) \frac{dZ}{dB_m}[$]
while uppercase will denote its CDF given as [$]P_{m0}=P(Z_m)[$]
The probability mass in mth cell which is the difference of CDF at boundaries is denoted as [$]\Delta P_{m}[$]
The derivatives of probability density function at center of mth cell in Bessel variable [$]B_m[$] are given as[$]\frac{dp_{m0}}{dB}=\frac{dp(Z_m)}{dZ} {(\frac{dZ}{dB_m})}^2+p(Z_m) \frac{d^2Z}{d{B_m}^2} [$]
We can similarly calculate higher derivatives [$]\frac{d^2p_{m0}}{d{B}^2}(B_{m0})[$] and [$]\frac{d^3p_{m0}}{d{B}^3}[$] by further differentiating the above function
We want to calculate the transition CDF, transition probability, and its derivatives from a cell m at time t, to an arbitrary point n on the grid at time t+1.
We first calculate the CDF from entire mth cell to nth point on grid at time t+1 and write it as an integral as
[$]\int_{B_{m1}}^{B_{m2}} p_m(B) P_{m,n}(B) dB[$] Equation(A)
Here [$]p_m(B)[$] indicates the probability density function at arbitrary point B within the mth subdivision(not necessarily at center).
Here [$]P_{m,n}(B)[$] indicates the CDF of transition probability from an arbitrary point B within the mth subdivision(not necessarily from its center) to arbitrary point [$]B_n[$] on next grid.
Our strategy to solve the above integral is to take derivatives of integrand at center of the grid cell [$]B_{m0}[$] and expand it as Taylor series and then solve it. Our expansion is basically constant values calculated at center of the mth subdivision(which are handily available) multiplied by an integral of the powers of difference of distance of two boundaries from the center. I have already indicated previously how to calculate these derivatives at center to any higher order.
So we have
[$]\int_{B_{m1}}^{B_{m2}} p_m(B) P_{m,n}(B) dB[$]
[$]=\int_{B_{m1}}^{B_{m2}} p_{m0} P_{m0,n} dB[$]
[$]+\int_{B_{m1}}^{B_{m2}} (\frac{dp_{m0}}{dB} P_{m0,n}+ p_{m0} p_{m0,n}) (B - B_{m0}) dB[$]
[$]+\int_{B_{m1}}^{B_{m2}} (\frac{d^2p_{m0}}{d{B}^2} P_{m0,n}+2 \frac{dp_{m0}}{dB} p_{m0,n}+ p_{m0} \frac{dp_{m0,n}}{dB}) \frac{{(B - B_{m0})}^2}{2} dB[$]
[$]+\int_{B_{m1}}^{B_{m2}} (\frac{d^3p_{m0}}{d{B}^3} P_{m0,n}+3 \frac{d^2p_{m0}}{d{B}^2} p_{m0,n}+3 \frac{dp_{m0}}{dB} \frac{dp_{m0,n}}{dB}+ p_{m0} \frac{d^2p_{m0,n}}{dB^3}) \frac{{(B - B_{m0})}^3}{6} dB[$] Equation(B)
We might have to expand to fourth order many times but I am not writing the higher order terms to make it easy to type here.
We re-arrange terms in the above equation(B) to write as
[$]\int_{B_{m1}}^{B_{m2}} p_m(B) P_{m,n}(B) dB[$]
[$]=\int_{B_{m1}}^{B_{m2}} p_{m0} P_{m0,n} dB[$]
[$]+\int_{B_{m1}}^{B_{m2}} (\frac{dp_{m0}}{dB} P_{m0,n}) (B - B_{m0}) dB[$]
[$]+\int_{B_{m1}}^{B_{m2}} (\frac{d^2p_{m0}}{d{B}^2} P_{m0,n}) \frac{{(B - B_{m0})}^2}{2} dB[$]
[$]+\int_{B_{m1}}^{B_{m2}} (\frac{d^3p_{m0}}{d{B}^3} P_{m0,n}) \frac{{(B - B_{m0})}^3}{6} dB[$]
[$]+\int_{B_{m1}}^{B_{m2}} ( p_{m0} p_{m0,n}) (B - B_{m0}) dB[$]
[$]+\int_{B_{m1}}^{B_{m2}} (2 \frac{dp_{m0}}{dB} p_{m0,n}+ p_{m0} \frac{dp_{m0,n}}{dB}) \frac{{(B - B_{m0})}^2}{2} dB[$]
[$]+\int_{B_{m1}}^{B_{m2}} (3 \frac{d^2p_{m0}}{d{B}^2} p_{m0,n}+3 \frac{dp_{m0}}{dB} \frac{dp_{m0,n}}{dB}+ p_{m0} \frac{d^2p_{m0,n}}{dB^3}) \frac{{(B - B_{m0})}^3}{6} dB[$] Equation(C)
We notice that first four terms in equation(C) after the equality sign and their series continuation equals the probability mass [$]\Delta P_m[$] in the mth cell(difference of CDF at boundaries) multiplied by transition CDF between the center of mth cell [$]B_{m0}[$] and point [$]B_n[$] on next time grid and we write those four terms again as
[$]\int_{B_{m1}}^{B_{m2}} p_{m0} P_{m0,n} dB[$]
[$]+\int_{B_{m1}}^{B_{m2}} (\frac{dp_{m0}}{dB} P_{m0,n}) (B - B_{m0}) dB[$]
[$]+\int_{B_{m1}}^{B_{m2}} (\frac{d^2p_{m0}}{d{B}^2} P_{m0,n}) \frac{{(B - B_{m0})}^2}{2} dB[$]
[$]+\int_{B_{m1}}^{B_{m2}} (\frac{d^3p_{m0}}{d{B}^3} P_{m0,n}) \frac{{(B - B_{m0})}^3}{6} dB[$]
[$]=(P_{m2}-P_{m1}) P_{m0,n}=\Delta P_m P_{m0,n}[$] Equation(D)
We write the above results of Equation(D) and substitute them in equation (C) and take constants out of the integrals to write the equation(E) as
[$]\int_{B_{m1}}^{B_{m2}} p_m(B) P_{m,n}(B) dB[$]
[$]=\Delta P_m P_{m0,n}[$]
[$]+ ( p_{m0} p_{m0,n}) \int_{B_{m1}}^{B_{m2}} (B - B_{m0}) dB[$]
[$]+ (2 \frac{dp_{m0}}{dB} p_{m0,n}+ p_{m0} \frac{dp_{m0,n}}{dB}) \int_{B_{m1}}^{B_{m2}} \frac{ {(B - B_{m0})}^2}{2} dB[$]
[$]+(3 \frac{d^2p_{m0}}{d{B}^2} p_{m0,n}+3 \frac{dp_{m0}}{dB} \frac{dp_{m0,n}}{dB}+ p_{m0} \frac{d^2p_{m0,n}}{dB^3}) \int_{B_{m1}}^{B_{m2}} \frac{{(B - B_{m0})}^3}{6} dB[$] Equation(E)
Please note that first term on RHS is what we had been using earlier as if all mass were concentrated at delta center of mth subdivision. Next three terms are corrections to CDF required for an appropriate and exact calculation of CDF at point [$]B_n[$] on next grid when probability mass from entire cell is considered. Please notice that all derivatives evaluated at the center of mth grid subdivision can be trivially calculated as I explained earlier and we are left with extremely simple integrals of powers of distance of boundaries from the center of subdivision which are again extremely simple to calculate.
Please note that all integrals with odd powers on [$](B - B_{m0}) [$] would have vanished if both grid boundaries were equidistant from the center.
We can repeat the steps to calculate the corrections for transition PDF and all its derivatives just like we solved for the CDF. We will get the same equation but every one degree higher derivative of CDF will mean one degree higher derivative(of transition probability between center [$]B_{m0}[$] and the point [$]B_n[$] on next boundary) terms in equation(E)
To find corrections to transition CDF, we solved the integral [$]\int_{B_{m1}}^{B_{m2}} p_m(B) P_{m,n}(B) dB[$] Equation(A)
In order to find corrections to transition PDF, we would solve the integral [$]\int_{B_{m1}}^{B_{m2}} p_m(B) p_{m,n}(B) dB[$] Equation(A2)
and so on for higher derivatives.
Sorry friends, it is a bit late(3:10 am) and I have to wake up early tomorrow so I will make any proper corrections of errors in this note tomorrow. I will remove "Post in progress" at start after I have removed any errors tomorrow.