## 2 Using Legendre Polynomials for Randomized Projection Estimates
### Expansion Coefficients of Density and Distribution Function  
The relation between expansion coefficients \(G_{i}\) and the statistical characteristics of the random variable \(\xi\) is established using a linear functional \(J\) defined by this density as  
\[J\varphi=\left(g,\varphi\right)_{L_{2}(\Omega)}=\int_{\Omega}g(x)\varphi(x) dx=\mathrm{E}\varphi(\xi), \tag{15}\]  
where \(\mathrm{E}\) means the mathematical expectation. In Formula (15), it is required to substitute the Legendre polynomials (6) instead of a function \(\varphi\), then  
\[G_{i}=\mathrm{E}\hat{P}_{i}(\xi),\ \ \ i=0,1,2,\ldots\]  
The series representation and the corresponding approximation by a partial sum of this series, similar to (7) and (8), can be obtained for an arbitrary orthonormal basis of \(L_{2}(\Omega)\). But the Legendre polynomials have an important advantage; namely, expansion coefficients \(G_{i}\) are easily expressed via initial moments of the random variable \(\xi\):  
\[\mathrm{M}_{k}=\mathrm{E}\xi^{k},\ \ \ k=1,2,\ldots\]  
Indeed, using Formulae (3) and (6), we have  
\[ \begin{split}\mathrm{E}\hat{P}_{i}(\xi)&=\frac{1}{2 ^{i}}\sqrt{\frac{2i+1}{2}}\sum_{k=0}^{\lfloor i/2\rfloor}\frac{(-1)^{k}(2i-2k )!}{k!(i-k)!(i-2k)!}\,\mathrm{E}\xi^{i-2k}\\ &=\frac{1}{2^{i}}\sqrt{\frac{2i+1}{2}}\sum_{k=0}^{\lfloor i/2 \rfloor}\frac{(-1)^{k}(2i-2k)!}{k!(i-k)!(i-2k)!}\,\mathrm{M}_{i-2k},\end{split}  \tag{16}\]  
where \(\mathrm{M}_{0}=1\). Another advantage of the chosen basis is that the antiderivative of any Legendre polynomial with index \(i>0\) is represented as a linear combination of two Legendre polynomials with neighboring indices due to recurrence relation (2) (for \(i=0\), one of the polynomials in a linear combination is also \(\hat{P}_{0}\)). Thus, having a projection estimate of the density, we can find a projection estimate of the distribution function by the simplest operations. The expressions required for this are obtained below. By integrating the left-hand and right-hand sides of relation (2) and taking into account the property of the Legendre polynomials [9], namely, the equality \(P_{i+1}(-1)=P_{i-1}(-1)\), we have  
\[(2i+1)\int_{-1}^{x}P_{i}(\theta)d\theta=P_{i+1}(x)-P_{i-1}(x),\ \ \ i=1,2,\ldots, \tag{17}\]  
or  
\[ \begin{split}&\sqrt{\frac{2i+1}{2}}\int_{-1}^{x}P_{i}(\theta)d \theta=\frac{1}{\sqrt{2(2i+1)}}\,P_{i+1}(x)-\frac{1}{\sqrt{2(2i+1)}}\,P_{i-1} (x)\\ &=\frac{1}{\sqrt{(2i+1)(2i+3)}}\,\sqrt{\frac{2i+3}{2}}\,P_{i+1} (x)-\frac{1}{\sqrt{(2i-1)(2i+1)}}\,\sqrt{\frac{2i-1}{2}}\,P_{i-1}(x),\end{split} \]i.e.,  
\[\int_{-1}^{x}\hat{P}_{i}(\theta)d\theta=\frac{1}{\sqrt{(2i+1)(2i+3)}}\,\hat{P}_{i+ 1}(x)-\frac{1}{\sqrt{(2i-1)(2i+1)}}\,\hat{P}_{i-1}(x),\ \ \ i=1,2,\ldots \tag{18}\]  
Given \(i=0\), we obtain  
\[\int_{-1}^{x}P_{0}(\theta)d\theta=\int_{-1}^{x}d\theta=x+1=P_{1}(x)+P_{0}(x),\]  
or  
\[\frac{1}{\sqrt{2}}\int_{-1}^{x}P_{0}(\theta)d\theta=\frac{1}{\sqrt{2}}\,P_{1} (x)+\frac{1}{\sqrt{2}}\,P_{0}(x)=\frac{1}{\sqrt{3}}\,\sqrt{\frac{3}{2}}\,P_{1} (x)+\frac{1}{\sqrt{2}}\,P_{0}(x),\]  
i.e.,  
\[\int_{-1}^{x}\hat{P}_{0}(\theta)d\theta=\frac{1}{\sqrt{3}}\,\hat{P}_{1}(x)+ \hat{P}_{0}(x). \tag{19}\]  
Relationship (12) between functions \(g\) and \(f\), as well as recurrent relations (18) and (19), implies that  
\[F_{0}=G_{0}-\frac{G_{1}}{\sqrt{3}},\ \ F_{i}=\frac{G_{i-1}}{\sqrt{(2i-1)(2i+1)}} -\frac{G_{i+1}}{\sqrt{(2i+1)(2i+3)}},\ \ i=1,2,\ldots \tag{20}\]  
**Remark 2**. : _The condition \(\Omega=[-1,1]\) does not reduce the generality of the above reasoning. Similar relations can be derived if the range of the random variable \(\xi\) is \(\Omega=[a,b]\) and \(g,f\in L_{2}(\Omega)\).