ajdmom.itos_mom
Itô process moments under Superposition of Two Square-Root Diffusion Processes
See 2FSV Model for superposition of two square-root diffusion processes.
I will demonstrate how to compute
(1)\[\mathbb{E}[m_4m_5m_6m_7m_8]
\triangleq
\mathbb{E}[I\!E_{1,n-1,t}^{m_4} I_{1,n-1,t}^{m_5} I\!E_{2,n-1,t}^{m_6} I_{2,n-1,t}^{m_7}
I_{n-1,t}^{*m_8}|v_{1,n-1},v_{2,n-1}].\]
Result
The result is presented first.
Function moment_IEI_IEII() is defined to compute
equation (1) which returns a Poly
with attribute
keyfor = ('((n_1m,n_2m,i_m),...,(n_11,n_21,i_1))',
'e^{(m_4*k1+m_6*k2)(n-1)h}','e^{(j_1*k1+j_2*k2)h}','h','v_{1,n-1}','theta1',
'sigma_v1','v_{2,n-1}','theta2','sigma_v2'),
i.e., with key components standing for
key[0]: \(((n_{1m},n_{2m},i_{m}),...,(n_{11},n_{21},i_{1}))\) for
\((n_{1m}k_1+n_{2m}k_2)^{-i_m}\cdots (n_{11}k_1+n_{21}k_2)^{-i_1}\),
key[1]: \((m_4,m_6)\) for \(e^{(m_4k_1+m_6k_2)(n-1)h}\)
key[2]: \((j_1,j_2)\) for \(e^{(j_1k_1+j_2k_2)[t-(n-1)h]}\),
key[3]: \(i\) for \([t-(n-1)h]^i\),
key[4],key[5],key[6]: \(v_{1,n-1}, \theta_1, \sigma_{v1}\)
raised to the respective power,
key[7],key[8],key[9]: \(v_{2,n-1}, \theta_2, \sigma_{v2}\)
raised to the respective power.
Therefore, I write the result of equation (1) as
\[\begin{split}&\mathbb{E}[m_4m_5m_6m_7m_8]\\
&= \sum_{t0,(m_4,m_6),(i,i'),j,l,p,q,l',p',q'}
b_{t0(m_4,m_6)(i,i')jlpql'p'q'} \cdot \\
&\quad (n_{1m}k_1+n_{2m}k_2)^{-i_m}
\cdots (n_{11}k_1+n_{21}k_2)^{-i_1}\cdot
e^{(m_4k_1+m_6k_2)(n-1)h}\cdot\\
&\quad e^{(ik_1+i'k_2)[t-(n-1)h]} [t-(n-1)h]^{j}
v_{1,n-1}^{l}\theta_1^{p}\sigma_{v1}^{q}
v_{2,n-1}^{l'}\theta_2^{p'}\sigma_{v2}^{q'}\end{split}\]
where \(t0 = ((n_{1m},n_{2m},i_{m}),...,(n_{11},n_{21},i_{1}))\).
Note that:
\(\mathbb{E}[I\!E_{1,n}^{m_4} I_{1,n}^{m_5} I\!E_{2,n}^{m_6} I_{2,n}^{m_7}
I_{n}^{*m_8}|v_{1,n-1},v_{2,n-1}] = \mathbb{E}[m_4m_5m_6m_7m_8|_{t=nh}]\).
I will show the deduction process in what follows.
Deduction
In order to compute equation
(1), I expand it by taking derivative as the following equation
shows
\[\begin{split}&d(I\!E_{1,n-1,t}^{m_4} I_{1,n-1,t}^{m_5} I\!E_{2,n-1,t}^{m_6} I_{2,n-1,t}^{m_7}
I_{n-1,t}^{*m_8})\\
&\approx \frac{1}{2}m_8(m_8-1)I\!E_{1,n-1,t}^{m_4} I_{1,n-1,t}^{m_5} I\!E_{2,n-1,t}^{m_6} I_{2,n-1,t}^{m_7}
I_{n-1,t}^{*m_8-2})v(t)dt\\
&\quad + c_1(t) I\!E_{2,n-1,t}^{m_6} I_{2,n-1,t}^{m_7} I_{n-1,t}^{*m_8} dt\\
&\quad + c_2(t) I\!E_{1,n-1,t}^{m_4} I_{1,n-1,t}^{m_5} I_{n-1,t}^{*m_8} dt\\
&\approx \frac{1}{2}m_8(m_8-1)I\!E_{1,n-1,t}^{m_4} I_{1,n-1,t}^{m_5} I\!E_{2,n-1,t}^{m_6} I_{2,n-1,t}^{m_7} I_{n-1,t}^{*m_8-2})v_1(t)dt\\
&\quad + \frac{1}{2}m_8(m_8-1)I\!E_{1,n-1,t}^{m_4} I_{1,n-1,t}^{m_5} I\!E_{2,n-1,t}^{m_6} I_{2,n-1,t}^{m_7} I_{n-1,t}^{*m_8-2})v_2(t)dt\\
&\quad + \frac{1}{2}m_4(m_4-1)e^{2k_1t}I\!E_{1,n-1,t}^{m_4-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{2,n-1,t}^{m_7}e^{2k_2t}
+ \frac{1}{2}m_7(m_7-1)I\!E_{2,n-1,t}^{m_6} I_{2,n-1,t}^{m_7-2}\\
&\qquad + m_6m_7I\!E_{2,n-1,t}^{m_6-1}I_{2,n-1,t}^{m_7-1}e^{k_2t}
\bigg] v_2(t),\end{split}\]
and
\[\begin{split}v_{1}(t)
&= e^{-k_1t}e^{k_1(n-1)h}(v_{1,n-1} - \theta_1) + \theta_1 + \sigma_{v1} e^{-k_1t}I\!E_{1,n-1,t},\\
v_{2}(t)
&= e^{-k_2t}e^{k_2(n-1)h}(v_{2,n-1} - \theta_2) + \theta_2 + \sigma_{v2} e^{-k_2t}I\!E_{2,n-1,t}.\end{split}\]
Recursive Equation
Thus, we have the following recursive equation
(2)\[\begin{split}&\mathbb{E}[m_4m_5m_6m_7m_8]&\\
&= \frac{m_4(m_4-1)}{2}e^{k_1(n-1)h}(v_{1,n-1} - \theta_1) &\int_{(n-1)h}^t e^{k_1s}\mathbb{E}[(m_4-2)m_5m_6m_7m_8]ds\\
&\quad + \frac{m_4(m_4-1)}{2}\theta_1 &\int_{(n-1)h}^t e^{2k_1s}\mathbb{E}[(m_4-2)m_5m_6m_7m_8]ds\\
&\quad + \frac{m_4(m_4-1)}{2}\sigma_{v1} &\int_{(n-1)h}^t e^{k_1s}\mathbb{E}[(m_4-1)m_5m_6m_7m_8]ds\\
&\quad + \frac{m_5(m_5-1)}{2}e^{k_1(n-1)h}(v_{1,n-1} - \theta_1) &\color{blue}\int_{(n-1)h}^t e^{-k_1s}\mathbb{E}[m_4(m_5-2)m_6m_7m_8]ds\\
&\quad + \frac{m_5(m_5-1)}{2}\theta_1 &\color{blue}\int_{(n-1)h}^t \mathbb{E}[m_4(m_5-2)m_6m_7m_8]ds\\
&\quad + \frac{m_5(m_5-1)}{2}\sigma_{v1} &\color{blue}\int_{(n-1)h}^t e^{-k_1s}\mathbb{E}[(m_4+1)(m_5-2)m_6m_7m_8]ds\\
&\quad + m_4m_5e^{k_1(n-1)h}(v_{1,n-1} - \theta_1) &\int_{(n-1)h}^t \mathbb{E}[(m_4-1)(m_5-1)m_6m_7m_8]ds\\
&\quad + m_4m_5\theta_1 &\int_{(n-1)h}^t e^{k_1s}\mathbb{E}[(m_4-1)(m_5-1)m_6m_7m_8]ds\\
&\quad + m_4m_5\sigma_{v1} &\int_{(n-1)h}^t \mathbb{E}[m_4(m_5-1)m_6m_7m_8]ds\\
&\quad + \frac{m_6(m_6-1)}{2}e^{k_2(n-1)h}(v_{2,n-1} - \theta_2) &\color{blue}\int_{(n-1)h}^t e^{k_2s}\mathbb{E}[m_4m_5(m_6-2)m_7m_8]ds\\
&\quad + \frac{m_6(m_6-1)}{2}\theta_2 &\color{blue}\int_{(n-1)h}^t e^{2k_2s}\mathbb{E}[m_4m_5(m_6-2)m_7m_8]ds\\
&\quad + \frac{m_6(m_6-1)}{2}\sigma_{v2} &\color{blue}\int_{(n-1)h}^t e^{k_2s}\mathbb{E}[m_4m_5(m_6-1)m_7m_8]ds\\
&\quad + \frac{m_7(m_7-1)}{2}e^{k_2(n-1)h}(v_{2,n-1} - \theta_2) &\int_{(n-1)h}^t e^{-k_2s}\mathbb{E}[m_4m_5m_6(m_7-2)m_8]ds\\
&\quad + \frac{m_7(m_7-1)}{2}\theta_2 &\int_{(n-1)h}^t \mathbb{E}[m_4m_5m_6(m_7-2)m_8]ds\\
&\quad + \frac{m_7(m_7-1)}{2}\sigma_{v2} &\int_{(n-1)h}^t e^{-k_2s}\mathbb{E}[m_4m_5(m_6+1)(m_7-2)m_8]ds\\
&\quad + m_6m_7e^{k_2(n-1)h}(v_{2,n-1} - \theta_2) &\color{blue}\int_{(n-1)h}^t \mathbb{E}[m_4m_5(m_6-1)(m_7-1)m_8]ds\\
&\quad + m_6m_7\theta_2 &\color{blue}\int_{(n-1)h}^t e^{k_2s}\mathbb{E}[m_4m_5(m_6-1)(m_7-1)m_8]ds\\
&\quad + m_6m_7\sigma_{v2} &\color{blue}\int_{(n-1)h}^t \mathbb{E}[m_4m_5m_6(m_7-1)m_8]ds\\
&\quad + \frac{m_8(m_8-1)}{2}e^{k_1(n-1)h}(v_{1,n-1} - \theta_1) &\int_{(n-1)h}^t e^{-k_1s}\mathbb{E}[m_4m_5m_6m_7(m_8-2)]ds\\
&\quad + \frac{m_8(m_8-1)}{2}\theta_1 &\int_{(n-1)h}^t \mathbb{E}[m_4m_5m_6m_7(m_8-2)]ds\\
&\quad + \frac{m_8(m_8-1)}{2}\sigma_{v1} &\int_{(n-1)h}^t e^{-k_1s}\mathbb{E}[(m_4+1)m_5m_6m_7(m_8-2)]ds\\
&\quad + \frac{m_8(m_8-1)}{2}e^{k_2(n-1)h}(v_{2,n-1} - \theta_2) &\color{blue}\int_{(n-1)h}^t e^{-k_2s}\mathbb{E}[m_4m_5m_6m_7(m_8-2)]ds\\
&\quad + \frac{m_8(m_8-1)}{2}\theta_2 &\color{blue}\int_{(n-1)h}^t \mathbb{E}[m_4m_5m_6m_7(m_8-2)]ds\\
&\quad + \frac{m_8(m_8-1)}{2}\sigma_{v2} &\color{blue}\int_{(n-1)h}^t e^{-k_2s}\mathbb{E}[m_4m_5(m_6+1)m_7(m_8-2)]ds.\end{split}\]
Initial Moments
For order 0, i.e., \(m_4+\cdots+m_8=0\), \(\mathbb{E}[m_4m_5m_6m_7m_8] = 1\).
And for order 1, \(m_4+\cdots+m_8=1\), \(\mathbb{E}[m_4m_5m_6m_7m_8] = 0\).
For order 2, i.e., \(m_4+\cdots+m_8=2\), \(\mathbb{E}[m_4m_5m_6m_7m_8] = 0\),
except for
\(m_4+m_5=2\):
\[\begin{split}&\mathbb{E}[I\!E_{1,n-1,t}^2|v_{1,n-1}]\\
&= e^{2k_1t}\frac{1}{2k_1}\theta_1 + e^{k_1t + k_1(n-1)h}\frac{1}{k_1}
(v_{1,n-1}-\theta_1) - e^{2k_1(n-1)h}\frac{1}{2k_1}\left(2v_{1,n-1}
- \theta_1 \right),\\
%
&\mathbb{E}[I\!E_{1,n-1,t}I_{1,n-1,t}|v_{1,n-1}]\\
&=e^{k_1t}\frac{1}{k_1}\theta_1
+ e^{k_1(n-1)h}(v_{1,n-1}-\theta_1)[t-(n-1)h]
- e^{k_1(n-1)h}\frac{1}{k_1}\theta_1,\\
%
&\mathbb{E}[I_{1,n-1,t}^2|v_{1,n-1}]\\
&= -e^{-k_1t + k_1(n-1)h}\frac{1}{k_1}(v_{1,n-1}-\theta_1)
+ \theta_1[t-(n-1)h] + (v_{1,n-1}-\theta_1)\frac{1}{k_1};\end{split}\]
\(m_6+m_7=2\):
\[\begin{split}&\mathbb{E}[I\!E_{2,n-1,t}^2|v_{2,n-1}]\\
&= e^{2k_2t}\frac{1}{2k_2}\theta_2 + e^{k_2t + k_2(n-1)h}\frac{1}{k_2}
(v_{2,n-1}-\theta_2) - e^{2k_2(n-1)h}\frac{1}{2k_2}\left(2v_{2,n-1}
- \theta_2 \right),\\
%
&\mathbb{E}[I\!E_{2,n-1,t}I_{2,n-1,t}|v_{2,n-1}]\\
&=e^{k_2t}\frac{1}{k_2}\theta_2
+ e^{k_2(n-1)h}(v_{2,n-1}-\theta_2)[t-(n-1)h]
- e^{k_2(n-1)h}\frac{1}{k_2}\theta_2,\\
%
&\mathbb{E}[I_{2,n-1,t}^2|v_{2,n-1}]\\
&= -e^{-k_2t + k_2(n-1)h}\frac{1}{k_2}(v_{2,n-1}-\theta_2)
+ \theta_2[t-(n-1)h] + (v_{2,n-1}-\theta_2)\frac{1}{k_2};\end{split}\]
\(m_8=2\):
\[\begin{split}&\mathbb{E}[I_{n-1,t}^{*2}|v_{1,n-1},v_{2,n-1}]\\
&= -e^{k_1(n-1)h}(v_{1,n-1}-\theta_1)\frac{1}{k_1}(e^{-k_1t} -
e^{-k_1(n-1)h}) +\theta_1 [t-(n-1)h]\\
&\quad -e^{k_2(n-1)h}(v_{2,n-1}-\theta_2)\frac{1}{k_2}(e^{-k_2t} -
e^{-k_2(n-1)h}) +\theta_2 [t-(n-1)h].\end{split}\]
Implementation
We have ,
\[\begin{split}\int e^{(n_1k_1+n_2k_2)t} t^m dt =
\begin{cases}
\sum_{i=0}^m c_{n_1n_2mi} e^{(n_1k_1+n_2k_2)t} t^{m-i} & \text{if } n_1k_1+n_2k_2\neq 0, m \neq 0,\\
\frac{1}{n_1k_1+n_2k_2}e^{(n_1k_1+n_2k_2)t}t^0 & \text{if } n_1k_1+n_2k_2\neq 0, m = 0,\\
\frac{1}{m+1}e^{0kt}t^{m+1} & \text{if } n_1k_1+n_2k_2 = 0, m \neq 0,\\
e^{0kt}t^1 & \text{if } n_1k_1+n_2k_2 =0 , m=0,
\end{cases}\end{split}\]
where \(c_{n_1n_2m0} \triangleq \frac{1}{n_1k_1+n_2k_2}\) and
(3)\[c_{n_1n_2mi} \triangleq \frac{(-1)^{i}}{(n_1k_1+n_2k_2)^{i+1}}
\prod_{j=m-i+1}^{m} j,~~ 1\le i \le m.\]
The coefficient \(c_{n_1n_2mi}\) is implemented in function
c().
For the definite integral
\[\int_{(n-1)h}^t e^{(n_1k_1+n_2k_2)[s-(n-1)h]}[s-(n-1)h]^mds
= F(t-(n-1)h) - F(0)\]
which is defined in int_et(),
where \(F(t) = \int e^{(n_1k_1+n_2k_2)t} t^m dt\).
In summary, I defined
int_et() which uses
c().
recursive_IEI_IEII() which uses
int_mIEI_IEII() and
coef_poly().
moment_IEI_IEII().
Functions
c(n1, n2, m, i)
|
Constant \(c_{n_1n_2mi}\) in (3) |
coef_poly(coef, poly, tp)
|
Multiply poly with different type coefficients |
int_et(n1, n2, m)
|
\(\int_{(n-1)h}^t e^{(n_1k_1+n_2k_2)[s-(n-1)h]}[s-(n-1)h]^mds\) |
int_mIEI_IEII(i, m, n4, n5, n6, n7, n8, IEI_IEII)
|
\(\int_{(n-1)h}^te^{mk_is}\mathbb{E}[n_4n_5n_6n_7n_8]ds\) |
moment_IEI_IEII(n4, n5, n6, n7, n8[, return_all])
|
Moment of \(\mathbb{E}[m_4m_5m_6m_7m_8]\) |
recursive_IEI_IEII(n4, n5, n6, n7, n8, IEI_IEII)
|
Recursive equation (2) |
t_mul_t0(t, t0)
|
multiply quant t0 with quant t |