ajdmom.cpp_mom

Moments of a Compound Poisson Process variable

Compound Poisson Process

\[J(t) = \sum_{i=0}^{N(t)}j_i,\quad j_i \sim \mathcal{N}(\mu_j,\sigma_j^2)\]

where \(N(t)\) is a Poisson process with rate \(\lambda\). For our purpose, I define variable \(J_n \triangleq \sum_{i=N((n-1)h)+1}^{N(nh)}j_i\) if \(N(nh) - N((n-1)h) > 0\), otherwise \(J_n \triangleq 0\).

Moment-Generating Function

For variable \(J_n\), its moment-generating function

\[M_{J_n}(s) = e^{\lambda h (M_{j_i}(s)-1)}, \qquad M_{j_i}(s) = e^{\mu_js+\frac{1}{2}\sigma_j^2s^2}.\]

where \(M_{j_i}(s)\) is the moment-generating function of normal variable \(j_i\).

MGF - CPP

For the first three derivatives,

\[\begin{split}M_{J_n}^{'}(s) &= e^{\lambda h (M_{j_i}(s)-1)} (\lambda h) M_{j_i}^{'}(s),\\ M_{J_n}^{''}(s) &= e^{\lambda h (M_{j_i}(s)-1)} \left[ (\lambda h)^2 M_{j_i}^{'2}(s) + (\lambda h) M_{j_i}^{''}(s) \right],\\ M_{J_n}^{(3)}(s) &= e^{\lambda h (M_{j_i}(s)-1)} \left[ (\lambda h)^3 M_{j_i}^{'3}(s) + 3(\lambda h)^2 M_{j_i}^{'}(s) M_{j_i}^{''}(s) + (\lambda h) M_{j_i}^{(3)}(s) \right].\end{split}\]

I propose to represent derivative of any order as

\[M^{(n)}_{J_n}(s) = \sum_{(i,(n1,m1),...,(nl,ml))} b_{key} (\lambda h)^i M_{j_i}^{(n1)m1}(s) \cdots M_{j_i}^{(nl)ml}(s)\]

where the leading term \(e^{\lambda h (M_{j_i}(s)-1)}\) has been omitted for notation simplicity, \(n1 < \cdots < nl\) and \(key=(i,(n1,m1),...,(nl,ml))\). Then its derivative can be computed as

\[\begin{split}M_{J_n}^{(n+1)}(s) &= \sum_{(i,(n1,m1),...,(nl,ml))} b_{key} (\lambda h)^{i+1} M_{j_i}^{(1)}(s) M_{j_i}^{(n1)m1}(s)\cdots M_{j_i}^{(nl)ml}(s)\\ &\quad+ \sum_{(i,(n1,m1),...,(nl,ml))} b_{key} (\lambda h)^i (M_{j_i}^{(n1)m1}(s)\cdots M_{j_i}^{(nl)ml}(s))',\end{split}\]

where again the leading term \(e^{\lambda h (M_{j_i}(s)-1)}\) has also been omitted. Rearrage the derivative to represent it as that of \(M^{(n)}_{J_n}(s)\).

MGF - Normal Distribution

For the first three derivatives,

\[\begin{split}M_{j_i}^{'}(s) &= e^{\mu_js+\frac{1}{2}\sigma_j^2s^2} (\mu_j + \sigma_j^2s),\\ M_{j_i}^{''}(s) &= e^{\mu_js+\frac{1}{2}\sigma_j^2s^2} \left[ (\mu_j + \sigma_j^2s)^2 + \sigma_j^2 \right],\\ M_{j_i}^{(3)}(s) &= e^{\mu_js+\frac{1}{2}\sigma_j^2s^2} \left[ (\mu_j + \sigma_j^2s)^3 + (\mu_j + \sigma_j^2s)\sigma_j^2 + 2(\mu_j + \sigma_j^2s)\sigma_j^2\right].\end{split}\]

I propose to represent derivative of any order as

\[M_{j_i}^{(n)}(s) = \sum_{i,j}b_{ij}(\mu+\sigma^2s)^i \sigma^{2j},\]

where the leading term \(e^{\mu_js+\frac{1}{2}\sigma_j^2s^2}\) has been omitted for notation simplicity.

Then its derivative is given as

\[M_{j_i}^{(n+1)}(s) = \sum_{i,j}b_{ij}(\mu+\sigma^2s)^{i+1} \sigma^{2j} +\sum_{i>0,j}b_{ij}i(\mu+\sigma^2s)^{i-1} \sigma^{2(j+1)}.\]

Rearrange the derivative to represent it as that of \(M^{(n)}_{j_i}(s)\).

In summary, I defined

  1. mnorm() to compute moment of normal variable which uses dmgf().

  2. mcpp() to compute moment of CPP variable which uses dmgf_cpp(), decode().

  3. cmcpp() to compute central moment of CPP variable.

Functions

cmcpp(n)

Central Moment of Compound Poisson Process of order n

d1_times_key(key)

Update the key after multiply with \((\lambda h)M_{j_i}'(s)\)

decode(poly)

Decode intermediate poly to target poly

dmgf(poly)

Derivative of normal Moment-Generating Function

dmgf_cpp(poly)

derivative of Moment Generating Function of CPP

dterm(key, coef)

Take derivative of each term

mcpp(n)

Moment of Compound Poisson Process variable of order n

mcpp_original(n)

Moment of Compound Poisson Process variable of order n

mnorm(n)

Moment of Normal distribution