## 7 Comparison of Projection Density Estimate and Histogram  
The classical method of estimating the density of a random variable is associated with a histogram [18], which is very often used in applied problems. We consider a histogram a projection estimate since the main results of this paper are related to projection estimates. We can define block pulse functions on the set \(\Omega\) as  
\[\hat{\Pi}_{i}(x)=\frac{1}{\sqrt{h}}\left\{ \begin{array}{ll}1& \text{for }x\in[ih-1,(i+1)h-1),\\ 0&\text{for }x\
otin[ih-1,(i+1)h-1),\end{array} \right. \tag{41}\] \[\qquad\qquad\qquad\qquad\qquad i=0,1,\ldots,L-1,\]  
where \(L\), a natural number, is the number of block pulse functions and \(h=2/L\). It is advisable to redefine the function \(\hat{\Pi}_{L-1}\) in such a way that it becomes continuous on the left at \(x=1\). Block pulse functions (41) form an orthonormal system of functions in \(L_{2}(\Omega)\). This system is not complete, but it can be used to approximate an arbitrary function \(u\in L_{2}(\Omega)\):  
\[u(x)\approx u^{\langle L\rangle*}(x)=\sum_{i=0}^{L-1}U_{i}^{*}\hat{\Pi}_{i}(x),\]  
where  
\[U_{i}^{*}=(u,\hat{\Pi}_{i})_{L_{2}(\Omega)}=\int_{\Omega}u(x)\hat{\Pi}_{i}(x) dx,\ \ \ i=0,1,\ldots,L-1.\]  
For \(L=2^{m}\) with natural \(m\), the first \(L\) Walsh or Haar functions on \(\Omega\) are exactly expressed through block pulse functions (41). Therefore, the results of this section can easily be adapted to the projection estimates of the distribution of a random variable using Walsh or Haar functions that form complete orthonormal systems of functions [26]. The approximation accuracy in \(L_{2}(\Omega)\) is usually estimated as follows [27]:  
\[\left\|u-u^{\langle L\rangle*}\right\|_{L_{2}(\Omega)}\leqslant\frac{C^{*}}{L }, \tag{42}\]  
where \(C^{*}>0\) does not depend on \(L\), under the condition \(u\in W_{2}^{1}(\Omega)\). As a function \(u\) in the given formulae, we can use the density \(g\) and the distribution function \(f\). We restrict ourselves to the density \(g\) only (the corresponding expansion coefficients are further denoted by \(G_{i}^{*}\)):\[g^{(L)*}(x)=\sum_{i=0}^{L-1}G_{i}^{*}\hat{\Gamma}_{i}(x), \tag{43}\]  
where  
\[G_{i}^{*} =\int_{\Omega}g(x)\hat{\Gamma}_{i}(x)dx=\frac{1}{\sqrt{h}}\int_{jh- 1}^{(i+1)h-1}g(x)dx\] \[=\frac{f((i+1)h-1)-f(ih-1)}{\sqrt{h}},\ \ i=0,1,\ldots,L-1.\]  
Thus, the calculation of expansion coefficients \(G_{\
u_{1},\
u_{2},i}^{*}\) of the density \(g_{\
u_{1},\
u_{2}}\) from a two-parameter family (30) is reduced to the calculation of values of the corresponding distribution function \(f_{\
u_{1},\
u_{2}}\) described by Formula (32), i.e.,  
\[G_{\
u_{1},\
u_{2},i}^{*}=\frac{f_{\
u_{1},\
u_{2}}((i+1)h-1)-f_{\
u_{1},\
u_{ 2}}(ih-1)}{\sqrt{h}},\ \ i=0,1,\ldots,L-1.\]  
To calculate the approximation error for the density \(g_{\
u_{1},\
u_{2}}\), we can use the formula similar to the first equation of Formula (39):  
\[\varepsilon_{g}^{(L)*}=\left\|g_{\
u_{1},\
u_{2}}-g_{\
u_{1},\
u_{2}}^{(L)*} \right\|_{L_{2}(\Omega)}=\biggl{(}\int_{-1}^{1}g_{\
u_{1},\
u_{2}}^{2}(x)dx- \sum_{i=0}^{L-1}(G_{\
u_{1},\
u_{2},i}^{*})^{2}\biggr{)}^{1/2}. \tag{44}\]  
The histogram can be defined by the expression based on approximation (43):  
\[g^{(L)*}(x)=\sum_{i=0}^{L-1}G_{i}^{*}\hat{\Gamma}_{i}(x),\]  
where \(G_{i}^{*}\) are estimates of expansion coefficients \(G_{i}\) based on observations of the random variable \(\xi\), \(i=0,1,\ldots,L-1\). For example,  
\[u(x)\approx u^{\langle L\rangle*}(x)=\sum_{i=0}^{L-1}U_{i}^{*}\hat{\Pi}_{i}(x),\]0  
where \(\xi_{l}\) is the \(l\)th realization and \(N\) is the sample size (number of realizations). The value \(h\) depending on \(L\) specifies the histogram step.