**5. Moments calculation**

We are now concerned with the following issue: to find the kth moments of a random value *τ* with the distribution density *p x*ð Þ:

$$\mathcal{E}\pi^{k} = \int\_{a}^{b} \pi^{k} p(\mathbf{x}) \, d\mathbf{x}. \tag{32}$$

In fact we have realizations of the random value *ξ* with a distribution density *q x*ð Þ. With *p x*ð Þ replaced by *q x*ð Þ in Eq. (32) we get an error

$$\int\_{a}^{b} \mathbf{x}^{k} p(\mathbf{x}) \, d\mathbf{x} - \int\_{a}^{b} \mathbf{x}^{k} q(\mathbf{x}) \, d\mathbf{x} = \int\_{a}^{b} \mathbf{x}^{k} [p(\mathbf{x}) - q(\mathbf{x})] \, d\mathbf{x}.\tag{33}$$

Suppose *b* ¼ ∞ and *ξ max* are the maximum value of the random variable over the all realizations for fixed *<sup>N</sup>*; then value of *<sup>ξ</sup> max* gives shift <sup>Ð</sup> <sup>∞</sup> *<sup>ξ</sup> max <sup>x</sup>kp x*ð Þ*dx* that increases both monotonically and without limit. The condition *q x*ð Þ¼ 0 as *x*>*ξ max* determines the lower limit of the last integral.

Many solutions of the boundary-value problems for the elliptic and parabolic Equations [4, 5] have a form of the expectations for the random value moments. Meaning of these expectations is the first exit time of the Wiener process trajectories to the domain boundary.

Let a domain be the three-dimensional ball with the radius *r* ¼ 1 and the Wiener trajectories start from the ball center; then a function of distribution of the first exit time for the Wiener trajectory is, in particular, given by [5].

$$F(t) = 1 + 2\sum\_{k=1}^{\infty} (-1)^k \exp\left(-k^2 \pi^2 t/2\right), \ t \in [0, +\infty). \tag{34}$$

From the above, we obtain the distribution density:

$$p(t) = 2\sum\_{k=1}^{\infty} (-1)^{k+1} \mu k^2 \exp\left(-\mu k^2 t\right), \quad \mu = \pi^2/2. \tag{35}$$

Assuming *τ* is distributed with this density and calculating the expectation of the *k*th moment we get

$$
\mathcal{E}\tau^k = \bigcap\_{0}^{\infty} t^k p(t) \, dt. \tag{36}
$$

In **Table 7**, we put the calculations results for *N* ¼ 1000000. The *k*th moment expectation can be represented in a form.

*Applied Probability Theory - New Perspectives, Recent Advances and Trends*

$$
\mathcal{E}\tau^k = \int\_0^\infty q(\mathbf{x}) t^k \frac{p(t)}{q(t)} dt,\tag{37}
$$

where *q t*ð Þ is some density in 0, ½ Þ <sup>∞</sup> . Taking *q t*ðÞ¼ *<sup>λ</sup>* exp ð Þ �*λ<sup>t</sup>* , for *<sup>λ</sup>* <sup>¼</sup> *<sup>π</sup>*2*=*2 we get that the number of realizations *ξ<sup>i</sup>* >1 will be almost twice as small as in the case of the modeling with the original *p t*ð Þ. In this situation we should obtain degradation of the estimation for the high moments. The calculations results with *q t*ð Þ for *N* ¼ 1000000 are represented in **Table 8**. However, in realizations at a computer we get the obvious


#### **Table 7.**

*The results of numerical calculations for the moments by the first way.*


#### **Table 8.**

*The results of numerical calculations for the moments by the second way.*

*Stability of Algorithms in Statistical Modeling DOI: http://dx.doi.org/10.5772/intechopen.106136*

improvement in quality of the moments estimation for all *k* from 5 to 20. Consider the choice of modeling strategy with regards to the variance. Suppose *ξ* and *η* be estimations of the statistical modeling for a value *J*, i.e., E*ξ* ¼ E*η* ¼ *J* with the variances of *σ*2 <sup>1</sup>ð Þ*<sup>ξ</sup>* , *<sup>σ</sup>*<sup>2</sup> <sup>2</sup>ð Þ*η* and the realizations of *ξ* ¼ ð Þ *ξ*<sup>1</sup> þ … þ *ξ<sup>N</sup> =N*, *η* ¼ ð Þ *η*<sup>1</sup> þ … þ *η<sup>N</sup> =N*. It would seem that for *σ*1ð Þ*ξ* < *σ*2ð Þ*η* the real estimation of *ξ* will be occurred close to the origin value of *J*. But this statement does not need to be always true. Without loss of generality it can believed that *J* ¼ 0. Additionally, if *N* is large enough then *ξ*, *η* are chosen be normal random variables with *N*ð Þ 0, *σ*<sup>1</sup> and *N*ð Þ 0, *σ*<sup>2</sup> , respectively. The following theorem holds.

**Proposition 6.** Let *ξ*, *η* be normal random variables, and *ξ* � *N*ð Þ 0, *σ*<sup>1</sup> , *η* � *N*ð Þ 0, *σ*<sup>2</sup> then *<sup>P</sup>*ð Þ¼ *<sup>ξ</sup>*j>j*η*<sup>j</sup> <sup>2</sup> *<sup>π</sup>* arctan *<sup>σ</sup>*<sup>1</sup> *σ*2 *:*

**Proof:**

$$P|\xi > |\eta| = \frac{1}{\sigma\_1 \sqrt{2\pi}} \int\_{-\infty}^{0} e^{-\frac{r^2}{2c\_1^2}} dy \left\{ \frac{1}{\sigma\_2 \sqrt{2\pi}} \left[ e^{-\frac{r^2}{2c\_1^2}} dx + \frac{1}{\sigma\_2 \sqrt{2\pi}} \left[ e^{-\frac{r^2}{2c\_2^2}} dx \right] + \right. \right. $$

$$+ \frac{1}{\sigma\_1 \sqrt{2\pi}} \int\_0^{\infty} e^{-\frac{r^2}{2c\_1^2}} dy \left\{ \frac{1}{\sigma\_2 \sqrt{2\pi}} \left[ e^{-\frac{r^2}{2c\_2^2}} dx + \frac{1}{\sigma\_2 \sqrt{2\pi}} \left[ e^{-\frac{r^2}{2c\_2^2}} dx \right] \right. \right. $$

$$= \frac{2}{\sigma\_1 \sqrt{2\pi}} \int\_0^{\infty} e^{-\frac{r^2}{2c\_1^2}} dy \left\{ \frac{2}{\sigma\_2 \sqrt{2\pi}} \left[ e^{-\frac{r^2}{2c\_2^2}} dx \right] \right. = \frac{4}{2\pi \sigma\_1 \sigma\_2} \left[ e^{-\frac{r^2}{2c\_1^2}} dy \cdot \int\_0^{\infty} e^{-\frac{r^2}{2c\_1^2}} dx \right]$$

Using Taylor expansion

$$e^{-\frac{\mathcal{y}^2}{2\sigma\_2^2}} = \sum\_{n=0}^{\infty} (-1)^n \frac{\mathcal{y}^{2n}}{2^n \sigma\_2^{2n} n!},$$

we get

$$\begin{aligned} \int\limits\_{0}^{\infty} \sum\_{n=0}^{\infty} (-1)^{n} \frac{\mathbf{x}^{2n}}{2^{n} \sigma\_{2}^{2n} n!} d\mathbf{x} &= \sum\_{n=0}^{\infty} (-1)^{n} \frac{y^{2n+1}}{(2n+1) 2^{n} \sigma\_{2}^{2n} n!}, \\ \int\limits\_{0}^{\infty} (-1)^{n} \frac{y^{2n+1}}{(2n+1) 2^{n} \sigma\_{2}^{2n} n!} e^{-\frac{r^{2}}{2\sigma\_{1}^{2}}} d\mathbf{y} &= \sum\_{n=0}^{\infty} (-1)^{n} \frac{1}{(2n+1) 2^{n} \sigma\_{2}^{2n} n!} \int\_{0}^{\infty} y^{2n+1} e^{-\frac{r^{2}}{2\sigma\_{1}^{2}}} d\mathbf{y} = \int\limits\_{0}^{\infty} (-1)^{n} \frac{1}{(2n+1) 2^{n} \sigma\_{2}^{2n} n!} \cdot \frac{2^{n+1} \sigma\_{1}^{2n+2} n!}{2} .\end{aligned}$$

Note that the last equality is obtained with the help of the formula:

$$\int\_0^\infty x^{2n+1} e^{-px^2} dx = \frac{n!}{2p^{n+1}}, \ p > 0.$$

In our case, *p* is <sup>1</sup> 2*σ*<sup>2</sup> 1 . We continue the equalities chain which is broken at (\*):


#### **Table 9.**

*The results of numerical calculations for the moments by the third way.*

$$\begin{split} \left( \* \right) = \sum\_{n=0}^{\infty} \left( -\mathbf{1} \right)^{n} \frac{\mathbf{1}}{\left( 2n + \mathbf{1} \right)} \frac{\sigma\_{1}^{2n+2}}{\sigma\_{2}^{2n}} = \sum\_{n=0}^{\infty} \left( -\mathbf{1} \right)^{n} \frac{\sigma\_{1}^{2}}{\left( 2n + \mathbf{1} \right)} \left( \frac{\sigma\_{1}}{\sigma\_{2}} \right)^{2n} = \\ &= \frac{2}{\pi} \sum\_{n=0}^{\infty} \left( -\mathbf{1} \right)^{n} \frac{\left( \sigma\_{1}/\sigma\_{2} \right)^{2n+1}}{2n+1} = \frac{2}{\pi} \arctan \frac{\sigma\_{1}}{\sigma\_{2}}. \end{split}$$

For the k-moment calculation we take

$$q\_k(t) = \frac{\lambda^{k+1} t^k e^{-\lambda t}}{k!}, \lambda = \frac{\pi^2}{2}$$

and get the results shown in **Table 9**.
