Next Article in Journal
EvoDevo: Bioinspired Generative Design via Evolutionary Graph-Based Development
Previous Article in Journal
Enhancing Ferroptosis-Related Protein Prediction Through Multimodal Feature Integration and Pre-Trained Language Model Embeddings
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Analysis and Conditional Optimization of Projection Estimates for Distribution of Random Variable Using Legendre Polynomials

by
Tatyana Averina
1 and
Konstantin Rybakov
2,*
1
Institute of Computational Mathematics and Mathematical Geophysics, Siberian Branch of the Russian Academy of Sciences, 630090 Novosibirsk, Russia
2
Moscow Aviation Institute, National Research University, 125993 Moscow, Russia
*
Author to whom correspondence should be addressed.
Algorithms 2025, 18(8), 466; https://doi.org/10.3390/a18080466
Submission received: 7 June 2025 / Revised: 13 July 2025 / Accepted: 23 July 2025 / Published: 26 July 2025
(This article belongs to the Section Randomized, Online, and Approximation Algorithms)

Abstract

Algorithms for jointly obtaining projection estimates of the density and distribution function of a random variable using Legendre polynomials are proposed. For these algorithms, a problem of conditional optimization is solved. Such optimization allows one to increase the approximation accuracy with minimum computational costs. The proposed algorithms are tested on examples with different degrees of smoothness of the density. A projection estimate of the density is compared to a histogram that is often used in applications to estimate distributions.

Graphical Abstract

1. Introduction

Statistical projection estimates in the Monte Carlo method were first proposed by N.N. Chentsov [1]. He developed a general technique for optimizing such estimates; this technique, however, requires clarification in specific problems [2]. In the paper [3], projection estimates based on the Legendre polynomials for marginal probability densities of solutions to stochastic differential equations were proposed. The mean square error of the estimates was studied, and a comparison of both the obtained projection estimates and the histogram was carried out with examples. The analysis of the results showed that for the same sample size, the projection estimate approximates the density more accurately. In addition, such an estimate is specified analytically, and it is a smooth function. So, it is preferable in, e.g., filtering problems and the control of nonlinear systems [4,5,6,7].
This paper presents two statistical algorithms, based on algorithms using Legendre polynomials from [3], for jointly obtaining projection estimates of the density and distribution function of a random variable.
When solving different problems by statistical estimation algorithms, it is important to make an optimal (consistent) choice of their parameters for finding the mathematical expectation of a certain functional that depends on a random variable. Therefore, this paper analyzes the mean square error of the projection estimate from this point of view. Such parameters are the projection expansion length and sample size. We solve a conditional optimization problem considered by G.A. Mikhailov [8]. The objective of this problem is to minimize the algorithm complexity while achieving the required level of approximation accuracy. We study how to minimize the mean square error of the projection estimates of the density and distribution function by the equalization of its deterministic and stochastic components. The accuracy of the projection estimates also depends on the degree of smoothness of the density; therefore, in this paper, we consider the dependence of error not only on the projection expansion length but also on the degree of smoothness of the approximated function.
The obtained theoretical results are confirmed with examples using a two-parameter family of densities that allows one both to choose the degree of smoothness and to perform a simple calculation of the expansion coefficients with respect to Legendre polynomials.
The rest of this paper has the following structure: Section 2 contains the necessary information on the Fourier–Legendre series and the definition of projection estimates of the density and distribution function; in this section, relations for expansion coefficients of the density and distribution function with respect to Legendre polynomials are obtained. Section 3 presents algorithms for jointly obtaining randomized projection estimates of the density and distribution function. The analysis and conditional optimization of randomized projection estimates are carried out in Section 4. Section 5 proposes a two-parameter family of densities with different degrees of smoothness and related distribution functions; it presents an algorithm for modeling the corresponding random variables, gives the expansion coefficients of the considered densities and distribution functions, and studies the convergence rate of their expansions. Numerical experiments and their analysis are discussed in Section 6. In Section 7, a projection estimate of the density is compared with a histogram. Brief conclusions on the paper are given in Section 8.

2. Using Legendre Polynomials for Randomized Projection Estimates

2.1. Fourier–Legendre Series

The standardized Legendre polynomials { P i } i = 0 are defined on the set Ω = [ 1 , 1 ] as follows [9]:
P i ( x ) = 1 2 i i ! d i ( x 2 1 ) i d x i , i = 0 , 1 , 2 ,
They form a complete orthogonal system of functions in the space L 2 ( Ω ) [10], where
L 2 ( Ω ) = u : Ω | u ( x ) | 2 d x < ,
and satisfy well-known recurrence relations:
( i + 1 ) P i + 1 ( x ) = ( 2 i + 1 ) x P i ( x ) i P i 1 ( x ) , i = 1 , 2 , ,
( 2 i + 1 ) P i ( x ) = P i + 1 ( x ) P i 1 ( x ) , i = 1 , 2 , ,
where P 0 ( x ) = 1 and P 1 ( x ) = x . These relations can be formally applied for i = 0 when P 1 ( x ) = 0 .
The explicit formula for the standardized Legendre polynomials is
P i ( x ) = 1 2 i k = 0 i / 2 ( 1 ) k ( 2 i 2 k ) ! k ! ( i k ) ! ( i 2 k ) ! x i 2 k , i = 0 , 1 , 2 , ,
where · is the floor function. The explicit formulae can be specified separately for even indices ( i = 2 j ), as
P 2 j ( x ) = 1 2 2 j k = 0 j ( 1 ) k ( 4 j 2 k ) ! k ! ( 2 j k ) ! ( 2 j 2 k ) ! x 2 j 2 k ,
and for odd indices ( i = 2 j + 1 ), as
P 2 j + 1 ( x ) = 1 2 2 j + 1 k = 0 j ( 1 ) k ( 4 j 2 k + 2 ) ! k ! ( 2 j k + 1 ) ! ( 2 j 2 k + 1 ) ! x 2 j 2 k + 1 .
Using the normalization, we obtain the Legendre polynomials { P ^ i } i = 0 that form a complete orthonormal system of functions in L 2 ( Ω ) :
P ^ i ( x ) = 2 i + 1 2 P i ( x ) , i = 0 , 1 , 2 ,
The expansion of an arbitrary function u L 2 ( Ω ) into the Fourier–Legendre series has the form
u ( x ) = i = 0 U i P ^ i ( x ) ,
where coefficients U i are defined as inner products, i.e.,
U i = ( u , P ^ i ) L 2 ( Ω ) = Ω u ( x ) P ^ i ( x ) d x , i = 0 , 1 , 2 ,
This expansion is a basis for the approximation of u:
u ( x ) u n ( x ) = i = 0 n U i P ^ i ( x ) ,
and the approximation accuracy is estimated depending on the chosen metric (or norm). For example, in L 2 ( Ω ) , we have [11]
u u n L 2 ( Ω ) C n s ,
where C > 0 does not depend on n, under the condition that the generalized derivatives of u up to order s belong to L 2 ( Ω ) . There is also the sharper estimate [12,13]
u u n L 2 ( Ω ) C ˜ ( n s + 1 ) ! ( n + s + 1 ) ! 1 / 2 ,
for which it is assumed that C ˜ > 0 does not depend on n, and the generalized derivatives of u up to order s belong to L 2 ( Ω ) with weight ρ ( x ) = ( 1 x 2 ) s , s n + 1 .
We also present the estimate corresponding to C ( Ω ) , the space of all continuous functions on Ω . If a function u is continuously differentiable r times on Ω , i.e., u C r ( Ω ) , and its derivative u ( r ) satisfies the Lipschitz condition with parameter α ( 0 , 1 ] , then
| u ( x ) u n ( x ) | C ^ n r + α 1 / 2 x Ω ,
where C ^ > 0 does not depend on n, r + α > 1 / 2 [9].
Remark 1.
In inequality (9), the parameter s can be a real non-negative number [14]. In this case, we should use the condition u W 2 s ( Ω ) for s 0 instead of the condition that the generalized derivatives of u up to order s belong to L 2 ( Ω ) . If s is a natural number, then W 2 s ( Ω ) , the Sobolev space, is defined in the usual way [10]:
W 2 s ( Ω ) = u : u ( k ) L 2 ( Ω ) , k = 0 , 1 , , s .
If s is not a natural number, then it is possible to define W 2 s ( Ω ) , the Sobolev–Slobodetskij space, by the complex interpolation between W 2 s ( Ω ) and W 2 s ( Ω ) [10,15], where s = s + 1 and W 2 0 ( Ω ) = L 2 ( Ω ) . However, we use another definition for W 2 s ( Ω ) from [15,16,17]:
W 2 s ( Ω ) = u L 2 ( Ω ) : Ω 2 | u ( x ) u ( y ) | 2 | x y | 1 + 2 s d x d y < , s = σ ( 0 , 1 ) ,
and
W 2 s ( Ω ) = u W 2 s ( Ω ) , u ( s ) W 2 σ ( Ω ) , σ = s s , s 1 .
The parameter s in inequalities (9) and (10) may be related to the condition that derivatives of fractional order s for u belong to L 2 ( Ω ) . For non-integer s, we should replace the ratio ( n s + 1 ) ! / ( n + s + 1 ) ! with the ratio Γ ( n s + 2 ) / Γ ( n + s + 2 ) in inequality (10), where Γ is the gamma function.

2.2. Projection Estimates of Density and Distribution Functions

Let ξ be the random variable with range Ω = [ 1 , 1 ] , density g, and distribution function f. The function g equals to zero outside Ω , and the function f is expressed through g [18]:
f ( x ) = x g ( θ ) d θ .
Further, we consider projection estimates of g , f L 2 ( Ω ) using their expansions into the Fourier–Legendre series (the restriction of the density and distribution function to Ω is implied). Note that the condition f L 2 ( Ω ) follows from the condition g L 2 ( Ω ) , which is assumed to be satisfied.
As a function u in the above formulae, we can use the density g and distribution function f (below, we denote the corresponding expansion coefficients by G i and F i ). In this case, the sequence f n converges to f faster than the sequence g n converges to g, where
g n ( x ) = i = 0 n G i P ^ i ( x ) , f n ( x ) = i = 0 n F i P ^ i ( x ) ,
since the degree of smoothness of f is greater by one than the degree of smoothness of g due to their relationship (12).
For example, let g be continuous on Ω , differentiable in a generalized sense only, i.e., s = 1 , r = 0 , and satisfy the Lipschitz condition with parameter α = 1 . Then,
g g n L 2 ( Ω ) C g n or g g n L 2 ( Ω ) C ˜ g ( n + 1 ) ( n + 2 ) , | g ( x ) g n ( x ) | C ^ g n 1 / 2 ,
and for f, the following estimates hold ( s = 2 , r = 1 , α = 1 ):
f f n L 2 ( Ω ) C f n 2 or f f n L 2 ( Ω ) C ˜ f n ( n + 1 ) ( n + 2 ) ( n + 3 ) , | f ( x ) f n ( x ) | C ^ f n 3 / 2 ,
where C g , C ˜ g , C ^ g , C f , C ˜ f , C ^ f > 0 are some constants and x Ω .
The projection estimates of the density and distribution function are given by expressions corresponding to their approximations (13):    
g ¯ n ( x ) = i = 0 n G ¯ i P ^ i ( x ) , f ¯ n ( x ) = i = 0 n F ¯ i P ^ i ( x ) ,
where G ¯ i and F ¯ i are estimates of expansion coefficients G i and F i based on observations of the random variable ξ [19,20], i = 0 , 1 , , n .

2.3. Expansion Coefficients of Density and Distribution Function

The relation between expansion coefficients G i and the statistical characteristics of the random variable ξ is established using a linear functional J defined by this density as
J φ = ( g , φ ) L 2 ( Ω ) = Ω g ( x ) φ ( x ) d x = E φ ( ξ ) ,
where E means the mathematical expectation. In Formula (15), it is required to substitute the Legendre polynomials (6) instead of a function φ , then
G i = E P ^ i ( ξ ) , i = 0 , 1 , 2 ,
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 ( Ω ) . But the Legendre polynomials have an important advantage; namely, expansion coefficients G i are easily expressed via initial moments of the random variable ξ :
M k = E ξ k , k = 1 , 2 ,
Indeed, using Formulae (3) and (6), we have
E P ^ i ( ξ ) = 1 2 i 2 i + 1 2 k = 0 i / 2 ( 1 ) k ( 2 i 2 k ) ! k ! ( i k ) ! ( i 2 k ) ! E ξ i 2 k = 1 2 i 2 i + 1 2 k = 0 i / 2 ( 1 ) k ( 2 i 2 k ) ! k ! ( i k ) ! ( i 2 k ) ! M i 2 k ,
where 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 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
( 2 i + 1 ) 1 x P i ( θ ) d θ = P i + 1 ( x ) P i 1 ( x ) , i = 1 , 2 , ,
or
2 i + 1 2 1 x P i ( θ ) d θ = 1 2 ( 2 i + 1 ) P i + 1 ( x ) 1 2 ( 2 i + 1 ) P i 1 ( x ) = 1 ( 2 i + 1 ) ( 2 i + 3 ) 2 i + 3 2 P i + 1 ( x ) 1 ( 2 i 1 ) ( 2 i + 1 ) 2 i 1 2 P i 1 ( x ) ,
i.e.,
1 x P ^ i ( θ ) d θ = 1 ( 2 i + 1 ) ( 2 i + 3 ) P ^ i + 1 ( x ) 1 ( 2 i 1 ) ( 2 i + 1 ) P ^ i 1 ( x ) , i = 1 , 2 ,
Given i = 0 , we obtain
1 x P 0 ( θ ) d θ = 1 x d θ = x + 1 = P 1 ( x ) + P 0 ( x ) ,
or
1 2 1 x P 0 ( θ ) d θ = 1 2 P 1 ( x ) + 1 2 P 0 ( x ) = 1 3 3 2 P 1 ( x ) + 1 2 P 0 ( x ) ,
i.e.,
1 x P ^ 0 ( θ ) d θ = 1 3 P ^ 1 ( x ) + P ^ 0 ( x ) .
Relationship (12) between functions g and f, as well as recurrent relations (18) and (19), implies that
F 0 = G 0 G 1 3 , F i = G i 1 ( 2 i 1 ) ( 2 i + 1 ) G i + 1 ( 2 i + 1 ) ( 2 i + 3 ) , i = 1 , 2 ,
Remark 2.
The condition Ω = [ 1 , 1 ] does not reduce the generality of the above reasoning. Similar relations can be derived if the range of the random variable ξ is Ω = [ a , b ] and g , f L 2 ( Ω ) . In this case, the orthonormal Legendre polynomials { P ^ i } i = 0 are defined by the expression
P ^ i ( x ) = 2 i + 1 b a P i 2 x ( b + a ) b a .

3. Algorithms for Jointly Obtaining Randomized Projection Estimates of Density and Distribution Functions

The randomization of the projection estimate of the density g is obtained by the first equation of Formula (14) as a result of calculating linear functional (15) for the Legendre polynomials (6) by the Monte Carlo method with independent realizations of the random variable ξ :
G ¯ i = 1 N l = 1 N P ^ i ( ξ l ) , i = 0 , 1 , 2 , ,
where ξ l is the lth realization and N is the sample size (number of realizations).
Estimates G ¯ i can also be obtained from expression (16) as
G ¯ i = 1 2 i 2 i + 1 2 k = 0 i / 2 ( 1 ) k ( 2 i 2 k ) ! k ! ( i k ) ! ( i 2 k ) ! M ¯ i 2 k ,
where M ¯ k are statistical estimates of initial moments of the random variable ξ ,
M ¯ k = 1 N l = 1 N ξ l k , k = 1 , 2 , ,
and M ¯ 0 = 1 . Using Formulae (4) and (5), we can write the expressions for the estimates of the density expansion coefficients separately for even indices ( i = 2 j ), as
G ¯ 2 j = 1 2 2 j 4 j + 1 2 k = 0 j ( 1 ) k ( 4 j 2 k ) ! k ! ( 2 j k ) ! ( 2 j 2 k ) ! M ¯ 2 j 2 k ,
and for odd indices ( i = 2 j + 1 ), as
G ¯ 2 j + 1 = 1 2 2 j + 1 4 j + 3 2 k = 0 j ( 1 ) k ( 4 j 2 k + 2 ) ! k ! ( 2 j k + 1 ) ! ( 2 j 2 k + 1 ) ! M ¯ 2 j 2 k + 1 .
The randomization of the projection estimate of the distribution function f is obtained by the second equation of Formula (14) and recurrence relations (20):
F ¯ 0 = G ¯ 0 G ¯ 1 3 , F ¯ i = G ¯ i 1 ( 2 i 1 ) ( 2 i + 1 ) G ¯ i + 1 ( 2 i + 1 ) ( 2 i + 3 ) , i = 1 , 2 ,
Here and below, the dependence of the estimates of both expansion coefficients and functions on the sample size N is not indicated for simplicity.
Remark 3.
To obtain a projection estimate of the distribution function f based on the first n + 1 Legendre polynomials, it is necessary to find estimates of the expansion coefficients of the density g with respect to the first n + 2 Legendre polynomials.
Further, we present Algorithm 1 for jointly obtaining randomized projection estimates of the density and distribution function of the random variable ξ .
Algorithm 1: Jointly obtaining projection estimates of the density and distribution function using explicit formulae for the Legendre polynomials.
0. Set the projection expansion length n and the sample size N.
1. Simulate N realizations ξ l of the random variable ξ , l = 1 , 2 , , N .
2. Find statistical estimates M ¯ k of initial moments of the random variable ξ using Formula (23), k = 1 , 2 , , n + 1 . Set M ¯ 0 = 1 .  3. Find estimates of expansion coefficients G ¯ i of the density g using Formula (22) or Formulae (24) and (25), i = 0 , 1 , , n + 1 .
4. Find estimates of expansion coefficients F ¯ i of the distribution function f using Formula (26), i = 0 , 1 , , n .
5. Find randomized projection estimates g ¯ n and f ¯ n of the density and distribution function, respectively, using Formula (14).
In step 3 in Algorithm 1, errors can occur due to the peculiarities of machine arithmetic when calculating expansion coefficients G ¯ i . To avoid this, it is recommended to use Formula (21) together with recurrence relation (1) and expression (6).
Next, we formulate Algorithm 2 for jointly obtaining randomized projection estimates of the density and distribution function.
Algorithm 2: Jointly obtaining projection estimates of the density and distribution function using the recurrence relation for the Legendre polynomials.
0. Set the projection expansion length n and the sample size N.
1. Simulate N realizations ξ l of the random variable ξ , l = 1 , 2 , , N .
2. Find estimates of expansion coefficients G ¯ i of the density g using Formula (21) together with recurrence relation (1) and expression (6), i = 0 , 1 , , n + 1 .
3. Find estimates of expansion coefficients F ¯ i of the distribution function f using Formula (26), i = 0 , 1 , , n .
4. Find randomized projection estimates g ¯ n and f ¯ n of the density and distribution function, respectively, using Formula (14).

4. Analysis and Conditional Optimization of Randomized Projection Estimates

In this section, we analyze the error of the projection estimate g ¯ n relative to the density g of the random variable ξ in L 2 ( Ω ) . Let B ( g , g ¯ n ) = E g g ¯ n L 2 ( Ω ) ; then,
B 2 ( g , g ¯ n ) = E g g ¯ n L 2 ( Ω ) 2 E Ω g ( x ) g ¯ n ( x ) 2 d x
due to Jensen’s inequality [21]. Further, we consider the following expression:
Ω g ( x ) g ¯ n ( x ) 2 d x = g g ¯ n L 2 ( Ω ) 2 = g g n + g n g ¯ n L 2 ( Ω ) 2 .
Functions g g n and g n g ¯ n are orthogonal in L 2 ( Ω ) since they belong to different subspaces. The first one is formed by the Legendre polynomials P ^ i for i = n + 1 , n + 2 , , and the second one is formed by the Legendre polynomials P ^ i for i = 0 , 1 , , n . This is a consequence of the equalities
g ( x ) = i = 0 G i P ^ i ( x ) , g n ( x ) = i = 0 n G i P ^ i ( x ) , g ¯ n ( x ) = i = 0 n G ¯ i P ^ i ( x ) ;
hence,
g g n + g n g ¯ n L 2 ( Ω ) 2 = g g n L 2 ( Ω ) 2 + g n g ¯ n L 2 ( Ω ) 2 .
According to Parseval’s identity [9], we have
g n g ¯ n L 2 ( Ω ) 2 = i = 0 n ( G i G ¯ i ) P ^ i ( x ) L 2 ( Ω ) 2 = i = 0 n ( G i G ¯ i ) 2
and
Ω g ( x ) g ¯ n ( x ) 2 d x = i = 0 n ( G i G ¯ i ) 2 + g g n L 2 ( Ω ) 2 .
Therefore, taking into account that the unbiased estimate of mathematical expectation is used [18], namely, E G ¯ i = G i , we obtain
B 2 ( g , g ¯ n ) E i = 0 n ( G i G ¯ i ) 2 + g g n L 2 ( Ω ) 2 = i = 0 n E ( G i G ¯ i ) 2 + g g n L 2 ( Ω ) 2 = i = 0 n D G ¯ i + g g n L 2 ( Ω ) 2 ,
where D denotes the variance.
The equality G ¯ 0 = G 0 is satisfied since P ^ 0 ( x ) = const , i.e., D G ¯ 0 = 0 . For i > 0 , the variance of estimates G ¯ i and the sample size N are inversely proportional [22]; therefore, using additionally inequality (9) under the condition g W 2 s ( Ω ) (see Remark 1), we find
B 2 ( g , g ¯ n ) C 1 g n N + C 2 g n 2 s ,
where C 1 g , C 2 g > 0 are constants independent of n and N.
The error of the projection estimate f ¯ n relative to the distribution function f of the random variable ξ in L 2 ( Ω ) is analyzed similarly:
B 2 ( f , f ¯ n ) C 1 f n N + C 2 f n 2 s + 2 ,
where C 1 f , C 2 f > 0 are constants independent of n and N.
From the obtained estimates, it is clear how the mean square error depends on the projection expansion length n and the sample size N.
Further, we consider a problem of the optimal (consistent) choice of parameters for statistical algorithms to obtain projection estimates of the density and distribution function: the projection expansion length n and the sample size N. For jointly obtaining these estimates by Algorithms 1 and 2, it is sufficient to consider the optimal choice of parameters for density estimation only and use them for distribution function estimation. This is because the degree of smoothness of f is greater than the degree of smoothness of g, so the sequence f ¯ n converges to f faster than the sequence g ¯ n converges to g.
The main result is stated using the symbol “≍”. The expression u ( n ) v ( n ) for suitable functions u and v means that u ( n ) = O ( v ( n ) ) and v ( n ) = O ( u ( n ) ) for n ; i.e., there exist constants C , C > 0 such that C | v ( n ) | | u ( n ) | C | v ( n ) | n > n , where n and n are natural numbers.
Theorem 1.
Let the density g of the random variable ξ belong to W 2 s ( Ω ) , and let g ¯ n be the randomized projection estimate of the density obtained by Algorithms 1 or 2 with the projection expansion length n and the sample size N. Then, the minimum complexity of obtaining the estimate g ¯ n is achieved with the parameters n = n opt and N = N opt that satisfy relations
N opt n opt 2 s + 1 , N opt γ ( 2 s + 1 ) / s , n opt γ 1 / s ,
where γ is the required approximation accuracy for the density g in L 2 ( Ω ) , i.e., B ( g , g ¯ n ) γ .
Proof. 
To find the optimal parameters n opt and N opt for the estimate g ¯ n , it is sufficient to equate terms [8] in Formula (28) and express the required approximation accuracy γ from the relation
C 1 g n N + C 2 g n 2 s = γ 2 .
From the equality
C 1 g n N = C 2 g n 2 s ,
we obtain the relationship for the optimal parameters, i.e., N opt n opt 2 s + 1 , as well as expressions
C 1 g n N = γ 2 2 and C 2 g n 2 s = γ 2 2 ,
and consequently, N opt γ ( 2 s + 1 ) / s and n opt γ 1 / s .    □
Theorem 1 establishes the relationship between parameters in Algorithms 1 and 2, n and N, as well as the dependence of approximation accuracy on parameter s. By choosing parameters in this way, we have
B ( g , g ¯ n ) c N s / ( 2 s + 1 ) ,
where c > 0 is a constant independent of n and N.
Remark 4.
The error (28) of the randomized projection estimate g ¯ n relative to the density g is based on inequality (9), but inequality (10) can also be used. Then, taking into account Remark 1, we have
B 2 ( g , g ¯ n ) C 1 g n N + C 2 g Γ ( n s + 2 ) Γ ( n + s + 2 ) .
It is possible to formulate an analogue of Theorem 1 and show that the following relationship between parameters for estimating the density g is conditionally optimal:
N opt n opt Γ ( n opt + s + 2 ) Γ ( n opt s + 2 ) .
Remark 5.
If the distribution function f of the random variable ξ belongs to W 2 s + 1 ( Ω ) (this condition holds if the density g of the random variable ξ belongs to W 2 s ( Ω ) , i.e., if the conditions of Theorem 1 are satisfied), then the minimum complexity of obtaining randomized projection estimate f ¯ n by Algorithms 1 or 2 is achieved with parameters n = n opt and N = N opt that satisfy relations
N opt n opt 2 s + 3 , N opt γ ( 2 s + 3 ) / ( s + 1 ) , n opt γ 1 / ( s + 1 ) ,
where γ is the required approximation accuracy for the function f in L 2 ( Ω ) , i.e., B ( f , f ¯ n ) γ .
The proof is similar to the proof of Theorem 1. Another relationship between parameters can be found if we take inequality (10) instead of inequality (9) (see Remark 4).

5. Two-Parameter Family of Densities with Different Degrees of Smoothness

In this section, a special example is proposed to test statistical algorithms for obtaining projection estimates depending on the projection expansion length, sample size, and smoothness of the estimated function.

5.1. Densities with Different Degrees of Smoothness and Related Distribution Functions

Let ξ be the random variable defined by the density g ν 1 , ν 2 :
g ν 1 , ν 2 ( x ) = γ ν 1 , ν 2 1 ( x ) ν 1 for x [ 1 , 0 ) , 1 x ν 2 for x [ 0 , 1 ] , 0 otherwise ,
where ν 1 and ν 2 are parameters (natural numbers) and γ ν 1 , ν 2 is a normalizing constant, with
1 γ ν 1 , ν 2 = 1 0 1 ( x ) ν 1 d x + 0 1 ( 1 x ν 2 ) d x = ν 1 ν 1 + 1 + ν 2 ν 2 + 1 ,
because
1 0 1 ( x ) ν d x = 0 1 ( 1 x ν ) d x = x x ν + 1 ν + 1 | 0 1 = 1 1 ν + 1 = ν ν + 1 .
Further, we assume that ν 1 ν 2 . The function g ν 1 , ν 2 has the following properties:
(a) g ν 1 , ν 2 is continuous on the set of real numbers;
(b) The support of g ν 1 , ν 2 is the set Ω = [ 1 , 1 ] ;
(c) The normalization condition holds:
+ g ν 1 , ν 2 ( x ) d x = 1 1 g ν 1 , ν 2 ( x ) d x = 1 ;
(d) g ν 1 , ν 2 is differentiable at x = 0 only r times:
g ν 1 , ν 2 C r ( Ω ) , r = min { ν 1 , ν 2 } 1 ;
(e) The derivative g ν 1 , ν 2 ( r + 1 ) exists almost everywhere on Ω ; if the derivative is understood in a generalized sense, then
g ν 1 , ν 2 ( s ) L 2 ( Ω ) , g ν 1 , ν 2 W 2 s ( Ω ) , s = r + 1 = min { ν 1 , ν 2 } .
Next, we determine the distribution function f ν 1 , ν 2 for the random variable ξ with density (30):
f ν 1 , ν 2 ( x ) = x g ν 1 , ν 2 ( θ ) d θ .
It is easy to see that f ν 1 , ν 2 ( x ) = 0 for x < 1 and f ν 1 , ν 2 ( x ) = 1 for x > 1 . Moreover,
1 x 1 ( θ ) ν d θ = θ + ( 1 ) ν + 1 θ ν + 1 ν + 1 | 1 x = ν ν + 1 + x + ( x ) ν + 1 ν + 1 , x [ 1 , 0 ] , 0 x ( 1 θ ν ) d θ = θ θ ν + 1 ν + 1 | 0 x = x x ν + 1 ν + 1 , x [ 0 , 1 ] ,
and consequently,
f ν 1 , ν 2 ( x ) = 0 1 2 for x < 1 , γ ν 1 , ν 2 ν 1 ν 1 + 1 + x + ( x ) ν 1 + 1 ν 1 + 1 for x [ 1 , 0 ) , γ ν 1 , ν 2 ν 1 ν 1 + 1 + x x ν 2 + 1 ν 2 + 1 for x [ 0 , 1 ] , 1 1 2 for x > 1 .
The function f ν 1 , ν 2 is differentiable r + 1 times at x = 0 since f ν 1 , ν 2 ( r + 1 ) = g ν 1 , ν 2 ( r ) due to relationship (31). Thus,
f ν 1 , ν 2 C r + 1 ( Ω ) , f ν 1 , ν 2 ( s + 1 ) L 2 ( Ω ) , f ν 1 , ν 2 W 2 s + 1 ( Ω ) .
If we do not restrict ourselves to the space W 2 s ( Ω ) with natural s (see Remark 1), then we can show that s < min { ν 1 , ν 2 } + 1 / 2 and sup s = min { ν 1 , ν 2 } + 1 / 2 .
Consider the case ν 1 > ν 2 . Then, the generalized derivative g ν 1 , ν 2 ( ν 2 ) is represented as a linear combination of functions η ( x ) and x ν 1 ν 2 η ( x ) , where η is the indicator of ( 0 , ) . It suffices to find a condition for parameter σ which ensures that η W 2 σ ( Ω ) , where W 2 σ ( Ω ) is defined by Formula (11) and σ ( 0 , 1 ) .
If x and y have the same sign, then | η ( x ) η ( y ) | = 0 , and if x and y have different signs, then | η ( x ) η ( y ) | = 1 . Hence,
Ω 2 | η ( x ) η ( y ) | 2 | x y | 1 + 2 σ d x d y = 1 0 0 1 d y | x y | 1 + 2 σ d x + 0 1 1 0 d y | x y | 1 + 2 σ d x .
The integrals on the right-hand side of the latter equality coincide since the integrand does not change when the signs of x and y change simultaneously. The convergence condition for them is σ < 1 / 2 . Indeed, for σ < 1 / 2 , we have    
1 0 0 1 d y | x y | 1 + 2 σ d x = 1 0 0 1 d y ( y x ) 1 + 2 σ d x = 1 2 σ 1 0 1 ( y x ) 2 σ | 0 1 d x = 1 2 σ 1 0 1 ( 1 x ) 2 σ 1 ( x ) 2 σ d x = 1 2 σ ( 2 σ 1 ) 1 ( 1 x ) 2 σ 1 | 1 0 + 1 ( x ) 2 σ 1 | 1 0 = 1 2 σ ( 2 σ 1 ) 1 2 2 σ 1 2 = 2 2 σ 1 σ ( 2 σ 1 )
and
Ω 2 | η ( x ) η ( y ) | 2 | x y | 1 + 2 σ d x d y = 2 ( 2 2 σ 1 ) σ ( 2 σ 1 ) .
For σ 1 / 2 , these integrals obviously diverge. Therefore, g ν 1 , ν 2 ( ν 2 ) W 2 σ ( Ω ) for σ < 1 / 2 , and g ν 1 , ν 2 W 2 s ( Ω ) for s < ν 2 + 1 / 2 .
The case ν 1 < ν 2 is similar to the considered case, so finally, g ν 1 , ν 2 W 2 s ( Ω ) and f ν 1 , ν 2 W 2 s + 1 ( Ω ) , provided that s < min { ν 1 , ν 2 } + 1 / 2 and sup s = min { ν 1 , ν 2 } + 1 / 2 .

5.2. Modeling Random Variables with Given Test Distributions Using Monte Carlo Method

The modeling formula for the random variable ξ with distribution function f ν 1 , ν 2 for parameters ν 1 and ν 2 can be derived using the inverse function method [22]: ξ = f ν 1 , ν 2 1 ( α ) , where f ν 1 , ν 2 1 is the inverse function to f ν 1 , ν 2 and α is the random variable having a uniform distribution on ( 0 , 1 ) .
Given the distribution function f ν 1 , ν 2 , we can obtain the Algorithm 3 for modeling the random variable ξ .
Algorithm 3: Modeling the random variable with given test density and distribution function.
0. Set parameters ν 1 , ν 2 , calculate γ ν 1 , ν 2 and f ν 1 , ν 2 ( 0 ) :
γ ν 1 , ν 2 = ν 1 ν 1 + 1 + ν 2 ν 2 + 1 1 , f ν 1 , ν 2 ( 0 ) = γ ν 1 , ν 2 ν 1 ν 1 + 1 = ν 1 ( ν 2 + 1 ) ν 1 + 2 ν 1 ν 2 + ν 2 .
1. Obtain a realization of the random variable α having a uniform distribution on ( 0 , 1 ) .
2. If α < f ν 1 , ν 2 ( 0 ) , then ξ is a root of the algebraic equation
ν 1 ν 1 + 1 + x + ( x ) ν 1 + 1 ν 1 + 1 α γ ν 1 , ν 2 = 0
from ( 1 , 0 ) , otherwise ξ is a root of the algebraic equation
ν 1 ν 1 + 1 + x x ν 2 + 1 ν 2 + 1 α γ ν 1 , ν 2 = 0
from [ 0 , 1 ) .
For small ν 1 and ν 2 , roots can be found analytically. Next, we obtain the modeling formulae for two cases used below.
Proposition 1.
For the random variable ξ with density
g ( x ) = 6 7 1 + x for x [ 1 , 0 ) , 1 x 2 for x [ 0 , 1 ] , 0 otherwise ,
the modeling formula is as follows:
ξ = 7 α 3 1 for α < 3 7 , Re A + 3 Im A for α 3 7 ,
where
A = 3 7 α 4 + ( 7 α 3 ) 2 16 1 3 .
Proof. 
The density g of the random variable ξ is included in a two-parameter family (30) for ν 1 = ν , ν 2 = ν + 1 , and ν = 1 : g = g 1 , 2 . For given parameters, we have
ν 1 ν 1 + 1 = 1 2 , γ 1 , 2 = 6 7 , f 1 , 2 ( 0 ) = 3 7 .
First, we consider the case α < f 1 , 2 ( 0 ) = 3 / 7 ; i.e., we should solve Equation (33). This is the quadratic equation
1 2 + x + x 2 2 7 α 6 = 0 , or x 2 + b x + c = 0 ,
where b = 2 , c = 1 7 α / 3 > 0 .
The function v ( x ) = x 2 + 2 x + 1 7 α / 3 has a minimum at x = 1 since v ( x ) = 2 x + 2 = 0 , v ( x ) = 2 > 0 and v ( x ) = 7 α / 3 < 0 . This means that the quadratic equation has two real roots (the discriminant is positive) and the largest of them determines ξ :
ξ = max { x 1 , x 2 } > x , x 1 , 2 = b 2 ± b 2 4 c = 1 ± 7 α 3 , ξ = 7 α 3 1 ( 1 , 0 ) .
Second, we consider the case α f 1 , 2 ( 0 ) = 3 / 7 ; i.e., we should solve Equation (34). This is the cubic equation
1 2 + x x 3 3 7 α 6 = 0 , or x 3 + p x + q = 0 ,
where p = 3 , q = ( 7 α 3 ) / 2 > 0 .
The function w ( x ) = x 3 3 x + ( 7 α 3 ) / 2 has extrema at x 1 , 2 = ± 1 : w ( x ) = 3 ( x 1 , 2 ) 2 3 = 0 . A minimum is reached at x 1 = 1 : w ( x 1 ) = 6 x 1 = 6 > 0 and w ( x 1 ) = 7 ( α 1 ) / 2 < 0 . A maximum is reached at x 2 = 1 : w ( x 2 ) = 6 x 2 = 6 < 0 and w ( x 2 ) = ( 1 + 7 α ) / 2 > 0 . This means that the cubic equation has three real roots (the discriminant is positive) and ξ is determined by the root that lies between the smallest and the largest roots. By using Cardano’s formulae for roots [23], we have
x 1 = A + B , x 2 , 3 = A + B 2 ± A B 2 3 i ,
where
A = q 2 + Q 3 , B = q 2 Q 3 , Q = p 3 3 + q 2 2 ,
and Q < 0 , which corresponds to the positive discriminant; therefore, A and B are complex conjugate numbers:
A + B 2 = Re A , A B 2 i = Im A and x 1 = 2 Re A , x 2 , 3 = Re A 3 Im A .
Let z = q / 2 + Q . Since Re z = q / 2 < 0 and Im z = Q > 0 , we obtain arg z ( π / 2 , π ) ; therefore, arg A ( π / 6 , π / 3 ) and
Re A , Im A > 0 , tan π 6 < Im A Re A < tan π 3 , or Re A < 3 Im A < 3 Re A .
Thus,
x 2 < x 3 < x 1 , ξ = A + B 2 A B 2 3 i = Re A + 3 Im A ( 0 , 1 ) ,
i.e., Formula (35) is valid. □
Proposition 2.
For the random variable ξ with density
g ( x ) = 12 17 1 + x 3 for x [ 1 , 0 ) , 1 x 2 for x [ 0 , 1 ] , 0 otherwise ,
the modeling formula is as follows:
ξ = Y 2 + Y 2 + 2 Y for α < 9 17 , Re A + 3 Im A for α 9 17 ,
where
Y = ω 17 α 9 9 ω , ω = 1 + 1 + ( 17 α 9 ) 3 729 3 , A = 9 17 α 8 + ( 17 α 9 ) 2 64 1 3 .
Proof. 
The density g of the random variable ξ is included in a two-parameter family (30) for ν 1 = ν + 1 , ν 2 = ν , and ν = 2 : g = g 3 , 2 . In this case,
ν 1 ν 1 + 1 = 3 4 , γ 3 , 2 = 12 17 , f 3 , 2 ( 0 ) = 9 17 .
The proof is the same as for Proposition 1, so some details are omitted. We only note that for α < f 3 , 2 ( 0 ) = 9 / 17 , Equation (33) is the quartic equation
3 4 + x + x 4 4 17 α 12 = 0 , or x 4 + b x + c = 0 ,
where b = 4 , c = 3 17 α / 3 > 0 , the polynomial v ( x ) = x 4 + 4 x + 3 17 α / 3 has a minimum at x = 1 , and v ( x ) = 17 α / 3 < 0 . The quartic equation has two real roots, and the largest of them determines ξ . It is convenient to find roots using Ferrari’s formulae [23].
For α f 3 , 2 ( 0 ) = 9 / 17 , Equation (34) is the cubic equation that is solved similarly to the cubic equation from the proof of Proposition 1. Such reasoning leads to Formula (36). □

5.3. Expansion Coefficients of Test Functions (Fourier–Legendre Series)

To exactly calculate the second term of the projection estimate error (27) in examples, we find expansion coefficients G ν 1 , ν 2 , i of the density g ν 1 , ν 2 , as well as expansion coefficients F ν 1 , ν 2 , i of the distribution function f ν 1 , ν 2 with respect to Legendre polynomials (6):
g ν 1 , ν 2 ( x ) = i = 0 G ν 1 , ν 2 , i P ^ i ( x ) , f ν 1 , ν 2 ( x ) = i = 0 F ν 1 , ν 2 , i P ^ i ( x ) .
First, we obtain the following values:
Q ν , i = 1 0 x ν P i ( x ) d x , Q ν , i + = 0 1 x ν P i ( x ) d x .
We multiply the left-hand and right-hand sides of relation (1) by x ν 1 and integrate over the interval [ 1 , 0 ] :
( i + 1 ) 1 0 x ν 1 P i + 1 ( x ) d x = ( 2 i + 1 ) 1 0 x ν P i ( x ) d x i 1 0 x ν 1 P i 1 ( x ) d x ,
or
( i + 1 ) Q ν 1 , i + 1 = ( 2 i + 1 ) Q ν , i i Q ν 1 , i 1 , Q ν , i = ( i + 1 ) Q ν 1 , i + 1 + i Q ν 1 , i 1 2 i + 1 .
Similarly, by multiplying the left-hand and right-hand sides of relation (1) by x ν 1 and integrating over the interval [ 0 , 1 ] , we obtain
Q ν , i + = ( i + 1 ) Q ν 1 , i + 1 + + i Q ν 1 , i 1 + 2 i + 1 .
These relations can be formally applied for i = 0 when Q ν , 1 = Q ν , 1 + = 0 but not for ν = 0 . Therefore, we should consider the case ν = 0 separately:
Q 0 , i = 1 0 P i ( x ) d x , Q 0 , i + = 0 1 P i ( x ) d x .
For i = 0 and i = 1 , we have
Q 0 , 0 = 1 0 P 0 ( x ) d x = 1 0 d x = 1 , Q 0 , 1 = 1 0 P 1 ( x ) d x = 1 0 x d x = 1 2 ,
and then we use relation (17):
Q 0 , i = 1 0 P i ( x ) d x = P i + 1 ( 0 ) P i 1 ( 0 ) 2 i + 1 , i = 1 , 2 ,
If i 0 is even, then P i + 1 ( 0 ) = P i 1 ( 0 ) = 0 according to Formula (5), and Q 0 , i = 0 . If i is odd, then we can apply the explicit Formula (4) or obtain an additional recurrence relation. We choose the latter way and take into account relation (1) for x = 0 :
( i + 1 ) P i + 1 ( 0 ) = i P i 1 ( 0 ) .
Then,
Q 0 , i Q 0 , i 2 = P i + 1 ( 0 ) P i 1 ( 0 ) 2 i + 1 2 i 3 P i 1 ( 0 ) P i 3 ( 0 ) = i i + 1 P i 1 ( 0 ) P i 1 ( 0 ) 2 i + 1 2 i 3 P i 1 ( 0 ) + i 1 i 2 P i 1 ( 0 ) = i i + 1 1 2 i + 1 2 i 3 1 + i 1 i 2 ,
i.e.,
Q 0 , i = 2 i i + 1 Q 0 , i 2 , i = 3 , 5 , 7 ,
The same reasoning leads to the following results:
Q 0 , 0 + = 0 1 P 0 ( x ) d x = 0 1 d x = 1 , Q 0 , 1 + = 0 1 P 1 ( x ) d x = 0 1 x d x = 1 2 ,
and
Q 0 , i + = P i 1 ( 0 ) P i + 1 ( 0 ) 2 i + 1 , i = 1 , 2 , ,
where Q 0 , i + = 0 for even i 0 . For odd i, we have
Q 0 , i + = 2 i i + 1 Q 0 , i 2 + , i = 3 , 5 , 7 ,
Thus, we obtain the general expression for calculating Q ν , i and Q ν , i + with arbitrary non-negative integers ν and i:
Q ν , i ± = 1 1 2 for ν = i = 0 , ± 1 2 for ν = 0 and i = 1 , 0 1 2 for ν = 0 and i = 2 , 4 , 6 , , 2 i i + 1 Q 0 , i 2 ± for ν = 0 and i = 3 , 5 , 7 , , ( i + 1 ) Q ν 1 , i + 1 ± + i Q ν 1 , i 1 ± 2 i + 1 otherwise ,
so that the expansion coefficients of the density g ν 1 , ν 2 with respect to Legendre polynomials (6) are expressed as follows (relation (37) is also used here):
G ν 1 , ν 2 , i = 1 1 g ν 1 , ν 2 ( x ) P ^ i ( x ) d x = γ ν 1 , ν 2 2 i + 1 2 1 0 1 ( x ) ν 1 P i ( x ) d x + 0 1 ( 1 x ν 2 ) P i ( x ) d x = γ ν 1 , ν 2 2 i + 1 2 Q 0 , i ( 1 ) ν 1 Q ν 1 , i + Q 0 , i + Q ν 2 , i + .
Expressions for the expansion coefficients of the distribution function f ν 1 , ν 2 are similarly obtained:
F ν 1 , ν 2 , i = 1 1 f ν 1 , ν 2 ( x ) P ^ i ( x ) d x = γ ν 1 , ν 2 2 i + 1 2 ( 1 0 ν 1 ν 1 + 1 + x + ( x ) ν 1 + 1 ν 1 + 1 P i ( x ) d x + 0 1 ν 1 ν 1 + 1 + x x ν 2 + 1 ν 2 + 1 P i ( x ) d x ) = γ ν 1 , ν 2 2 i + 1 2 ( ν 1 ν 1 + 1 Q 0 , i + Q 1 , i + ( 1 ) ν 1 + 1 ν 1 + 1 Q ν 1 + 1 , i + ν 1 ν 1 + 1 Q 0 , i + + Q 1 , i + 1 ν 2 + 1 Q ν 2 + 1 , i + ) .
These expressions for the expansion coefficients of the density g ν 1 , ν 2 and distribution function f ν 1 , ν 2 are used for their approximation as
g ν 1 , ν 2 ( x ) g ν 1 , ν 2 n ( x ) = i = 0 n G ν 1 , ν 2 , i P ^ i ( x ) , f ν 1 , ν 2 ( x ) f ν 1 , ν 2 n ( x ) = i = 0 n F ν 1 , ν 2 , i P ^ i ( x ) ,
and for the approximation error:
ε g n = g ν 1 , ν 2 g ν 1 , ν 2 n L 2 ( Ω ) = 1 1 g ν 1 , ν 2 2 ( x ) d x i = 0 n G ν 1 , ν 2 , i 2 1 / 2 , ε f n = f ν 1 , ν 2 f ν 1 , ν 2 n L 2 ( Ω ) = 1 1 f ν 1 , ν 2 2 ( x ) d x i = 0 n F ν 1 , ν 2 , i 2 1 / 2 .

5.4. Analysis of Convergence Rate for Expansions of Test Functions

Consider the function
y ν ( x ) = x ν for x [ 1 , 0 ) , 0 for x [ 0 , 1 ] ,
where ν is a parameter (natural number). Its expansion coefficients Y ν , i with respect to Legendre polynomials (6) are expressed through the previously found values Q ν , i :
y ν ( x ) = i = 0 Y ν , i P ^ i ( x ) , Y ν , i = 2 i + 1 2 Q ν , i .
Further, we derive the recurrence relation for Q ν , i , different from relation (38). We multiply the left-hand and right-hand sides of relation (1) by x ν and integrate over the interval [ 1 , 0 ] :
( i + 1 ) 1 0 x ν P i + 1 ( x ) d x = ( 2 i + 1 ) 1 0 x ν + 1 P i ( x ) d x i 1 0 x ν P i 1 ( x ) d x .
Next, we use the rule of integration by parts:
1 0 x ν + 1 P i ( x ) d x = x ν + 1 Θ i ( x ) | 1 0 ( ν + 1 ) 1 0 x ν Θ i ( x ) d x , Θ i ( x ) = 1 x P i ( θ ) d θ ,
and consequently, taking into account equality (17), we obtain
1 0 x ν + 1 P i ( x ) d x = ν + 1 2 i + 1 1 0 x ν P i + 1 ( x ) P i 1 ( x ) d x ;
therefore,
( i + 1 ) 1 0 x ν P i + 1 ( x ) d x = ( ν + 1 ) 1 0 x ν P i + 1 ( x ) P i 1 ( x ) d x i 1 0 x ν P i 1 ( x ) d x ,
or
( i + 1 ) Q ν , i + 1 = ( ν + 1 ) ( Q ν , i + 1 Q ν , i 1 ) i Q ν , i 1 ,
i.e.,
Q ν , i + 1 = ν i + 1 ν + i + 2 Q ν , i 1 and Y ν , i + 1 = 2 i + 3 2 i 1 ν i + 1 ν + i + 2 Y ν , i 1 .
The series formed by the squared expansion coefficients Y ν , i converges since y ν L 2 ( Ω ) . It can be represented as a sum of two series:
i = 0 ( Y ν , i ) 2 = j = 0 ( Y ν , 2 j ) 2 + j = 0 ( Y ν , 2 j + 1 ) 2 .
The Raabe–Duhamel test [24] implies that the first series (similarly for the second one) converges in the same way as the series
j = 1 1 j 2 ν + 2 ,
since the sequence
R j = j ( Y ν , 2 j ) 2 ( Y ν , 2 j + 2 ) 2 1 = j 4 j 1 4 j + 3 ν + 2 j + 2 ν 2 j + 1 2 1
has the limit lim j R j = 2 ν + 2 , but the convergence of this series is equivalent to the convergence of the integral
1 + d t t 2 ν + 2 = 1 ( 2 ν + 1 ) t 2 ν + 1 | 1 + = 1 2 ν + 1 lim t 1 t 2 ν + 1 1
which takes place under the condition 2 ν + 1 > 0 , or ν > 1 / 2 .
As a result, using Parseval’s identity, we find
y ν y ν n L 2 ( Ω ) 2 = i = n + 1 ( Y ν , i ) 2 C 2 n 2 ν + 1 and y ν y ν n L 2 ( Ω ) C n ν + 1 / 2 , C > 0 ,
where
y ν n ( x ) = i = 0 n Y ν , i P ^ i ( x ) ,
and this corresponds to estimate (9) with the limit value s = ν + 1 / 2 (see Remark 1).
The obtained result can be transferred to the function
y ν + ( x ) = 0 for x [ 1 , 0 ) , x ν for x [ 0 , 1 ] ,
and its expansion coefficients Y ν , i + with respect to Legendre polynomials (6). The easiest way to prove this is the use of the equality | Y ν , i | = | Y ν , i + | , which follows from the relation between expansion coefficients of an arbitrary function from L 2 ( Ω ) and its reflection [25]. Therefore, the same result holds for the function g ν 1 , ν 2 . This result can be extended to the function f ν 1 , ν 2 due to its degree of smoothness is greater by one than the degree of smoothness of g ν 1 , ν 2 .
Thus,
ε g n C g n min { ν 1 , ν 2 } + 1 / 2 , ε f n C f n min { ν 1 , ν 2 } + 3 / 2 ,
where C g , C f > 0 are some constants. Moreover, we can assume that ν 1 and ν 2 are real positive numbers, and if we consider g ν 1 , ν 2 not to be a density but some function not bound by the probability theoretical framework, then the condition ν 1 , ν 2 > 1 / 2 is admissible. Such a convergence reflects that g ν 1 , ν 2 ( s ) W 2 s ( Ω ) and f ν 1 , ν 2 ( s ) W 2 s + 1 ( Ω ) subject to s < min { ν 1 , ν 2 } + 1 / 2 and sup s = min { ν 1 , ν 2 } + 1 / 2 . It corresponds to estimate (9).

6. Numerical Experiments

In this section, we present the results of the joint estimation of the density and distribution function for two examples that use a two-parameter family (30) of densities with different degrees of smoothness. In these examples, the results are presented in the tables that contain the errors of the projection estimates of the density and distribution function in L 2 ( Ω ) . We study the dependence of error on the projection expansion length (for the maximum degree n of the Legendre polynomials, values 4, 8, 16, 32, and 64 are used, i.e., n = 2 k + 2 for k = 0 , 1 , , 4 ), on the sample size N = 2 m + 9 for m = 0 , 1 , , 18 , and on the degree of smoothness of the approximated density (see Examples 1 and 2 below). Algorithm 2 is applied for estimation.
These examples show the approximation errors ε g n and ε f n , which are calculated using Formula (39), i.e., deterministic components of projection estimate errors. In the tables, they are in rows marked by the symbol “∗”. The remaining rows contain errors that include deterministic and stochastic components. The formulae for these errors follow from Parseval’s identity:
ε ¯ g n = 1 1 g ν 1 , ν 2 2 ( x ) d x i = 0 n G ν 1 , ν 2 , i 2 + i = 0 n ( G ν 1 , ν 2 , i G ¯ ν 1 , ν 2 , i ) 2 1 / 2 , ε ¯ f n = 1 1 f ν 1 , ν 2 2 ( x ) d x i = 0 n F ν 1 , ν 2 , i 2 + i = 0 n ( F ν 1 , ν 2 , i F ¯ ν 1 , ν 2 , i ) 2 1 / 2 ,
where G ¯ ν 1 , ν 2 , i and F ¯ ν 1 , ν 2 , i are estimates of expansion coefficients G ν 1 , ν 2 , i and F ν 1 , ν 2 , i , respectively. For an arbitrary density g, a similar formula was used to obtain estimate (27).
Example 1.
Let g ν 1 , ν 2 be the density from a two-parameter family (30), and let f ν 1 , ν 2 be the related distribution function described by Formula (32), with the following parameters: ν 1 = ν , ν 2 = ν + 1 for ν = 1 . The modeling formula is given in Proposition 1.
The function g 1 , 2 is continuous, non-differentiable at x = 0 , but its first-order derivative exists almost everywhere on Ω: g 1 , 2 C ( Ω ) , g 1 , 2 ( 1 ) L 2 ( Ω ) , i.e., g 1 , 2 W 2 1 ( Ω ) . However, if we do not restrict ourselves to the space W 2 s ( Ω ) with natural s (see Remark 1), then g 1 , 2 W 2 s ( Ω ) for s < min { ν 1 , ν 2 } + 1 / 2 = 3 / 2 ( sup s = 3 / 2 ). The degree of smoothness of f 1 , 2 is greater, and f 1 , 2 W 2 s + 1 ( Ω ) . This corresponds to Formulae (40), which take the form
ε g n C g n 3 / 2 , ε f n C f n 5 / 2
for given parameters ν 1 and ν 2 .
According to Theorem 1, for the limit value s = 3 / 2 , to achieve the required approximation accuracy B ( g 1 , 2 , g ¯ 1 , 2 n ) = γ c N 3 / 8 , c > 0 , the conditionally optimal parameters should be as follows: N opt n opt 4 ; this is confirmed by the statistical modeling results (see Table 1 and Table 2). In the row “∗” of Table 1, the deterministic component of error decreases by approximately 2 3 / 2 2.8 times (in Table 2, by approximately 2 5 / 2 5.6 times) when the projection expansion length n is doubled. In the rest of this table, errors corresponding to optimal parameters n opt and N opt are highlighted in bold, and they are consistent with the relationship N opt n opt 4 . Table 2 demonstrates higher accuracy of distribution function estimation.
In our calculations with the formulae for errors, the following values are used (squared norms of the functions g 1 , 2 and f 1 , 2 ):
1 1 g 1 , 2 2 ( x ) d x = 156 245 , 1 1 f 1 , 2 2 ( x ) d x = 235 343 .
For clarity, Figure 1 contains the approximation errors in graphical form. One axis shows k = 0 , 1 , , 4 , which determines the projection expansion length, n = 2 k + 2 , and another axis shows m = 0 , 1 , , 18 , which determines the sample size, N = 2 m + 9 . The vertical axis corresponds to the density approximation errors.
The example under consideration corresponds to the left part of Figure 1, which presents two surfaces. The first one (red) corresponds to the obtained computational error, it is formed on data from Table 1. The second one (blue, with marked nodes) corresponds to the theoretical error according to Formula (28) with s = 3 / 2 :
ϵ g n C 1 g n N + C 2 g n 3 .
Constants C 1 g = 0.885 and C 2 g = 0.276 are approximately determined based on the condition of a minimum sum of squared deviations between the theoretical error and computational error.
Example 2.
Let g ν 1 , ν 2 be the density from a two-parameter family (30), and let f ν 1 , ν 2 be the related distribution function described by Formula (32), with the following parameters: ν 1 = ν + 1 , ν 2 = ν for ν = 2 . The modeling formula is given in Proposition 2.
The function g 3 , 2 is continuous, differentiable everywhere on Ω, and its second-order derivative exists almost everywhere on Ω: g 3 , 2 C 1 ( Ω ) , g 3 , 2 ( 2 ) L 2 ( Ω ) ; hence, g 3 , 2 W 2 2 ( Ω ) . Considering the space W 2 s ( Ω ) with real non-negative s (see Remark 1), we affirm that g 3 , 2 W 2 s ( Ω ) for s < min { ν 1 , ν 2 } + 1 / 2 = 5 / 2 ( sup s = 5 / 2 ). The degree of smoothness of f 3 , 2 is greater, and f 3 , 2 W 2 s + 1 ( Ω ) . This corresponds to Formula (40) when substituting given parameters ν 1 and ν 2 :
ε g n C g n 5 / 2 , ε f n C f n 7 / 2 .
Theorem 1 implies that in order to achieve the required approximation accuracy B ( g 3 , 2 , g ¯ 3 , 2 n ) = γ c N 5 / 12 , c > 0 , with the limit value s = 5 / 2 , the conditionally optimal parameters should satisfy the relationship N opt n opt 6 , and this is illustrated by the statistical modeling results from Table 3 and Table 4. In the row “∗” of Table 3, if the projection expansion length n is doubled, then the deterministic component of error decreases by approximately 2 5 / 2 5.6 times (in Table 4, by approximately 2 7 / 2 11.2 times). In the rest of this table, errors corresponding to optimal parameters n opt and N opt are shown in bold, and they are consistent with the relationship N opt n opt 6 . Table 4 shows higher accuracy of distribution function estimation.
In our calculations with the formulae for errors, the following values are used (squared norms of the functions g 3 , 2 and f 3 , 2 ):
1 1 g 3 , 2 2 ( x ) d x = 5928 10115 , 1 1 f 3 , 2 2 ( x ) d x = 7801 10115 .
Figure 1 contains a graphical representation of the numerical experiment. The meaning of different axes is described in Example 1. This example corresponds to the right part of Figure 1 with two surfaces. The first one (red) is constructed from the obtained computational error given in Table 3, and the second one (blue, with marked nodes) corresponds to the theoretical error according to Formula (28) with s = 5 / 2 :
ϵ g n C 1 g n N + C 2 g n 5 ,
where constants C 1 g = 0.890 and C 2 g = 0.545 are chosen from the same condition as in Example 1.

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 Ω as
Π ^ i ( x ) = 1 h 1 for x [ i h 1 , ( i + 1 ) h 1 ) , 0 for x [ i h 1 , ( i + 1 ) h 1 ) , i = 0 , 1 , , 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 Π ^ 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 ( Ω ) . This system is not complete, but it can be used to approximate an arbitrary function u L 2 ( Ω ) :
u ( x ) u L ( x ) = i = 0 L 1 U i Π ^ i ( x ) ,
where
U i = ( u , Π ^ i ) L 2 ( Ω ) = Ω u ( x ) Π ^ i ( x ) d x , i = 0 , 1 , , L 1 .
For L = 2 m with natural m, the first L Walsh or Haar functions on Ω 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 ( Ω ) is usually estimated as follows [27]:
u u L L 2 ( Ω ) C L ,
where C > 0 does not depend on L, under the condition u W 2 1 ( Ω ) .
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 ) = i = 0 L 1 G i Π ^ i ( x ) ,
where
G i = Ω g ( x ) Π ^ i ( x ) d x = 1 h i h 1 ( i + 1 ) h 1 g ( x ) d x = f ( ( i + 1 ) h 1 ) f ( i h 1 ) h , i = 0 , 1 , , L 1 .
Thus, the calculation of expansion coefficients G ν 1 , ν 2 , i of the density g ν 1 , ν 2 from a two-parameter family (30) is reduced to the calculation of values of the corresponding distribution function f ν 1 , ν 2 described by Formula (32), i.e.,
G ν 1 , ν 2 , i = f ν 1 , ν 2 ( ( i + 1 ) h 1 ) f ν 1 , ν 2 ( i h 1 ) h , i = 0 , 1 , , L 1 .
To calculate the approximation error for the density g ν 1 , ν 2 , we can use the formula similar to the first equation of Formula (39):
ε g L = g ν 1 , ν 2 g ν 1 , ν 2 L L 2 ( Ω ) = 1 1 g ν 1 , ν 2 2 ( x ) d x i = 0 L 1 ( G ν 1 , ν 2 , i ) 2 1 / 2 .
The histogram can be defined by the expression based on approximation (43):
g ¯ L ( x ) = i = 0 L 1 G ¯ i Π ^ i ( x ) ,
where G ¯ i are estimates of expansion coefficients G i based on observations of the random variable ξ , i = 0 , 1 , , L 1 . For example,
G ¯ i = 1 N l = 1 N Π ^ i ( ξ l ) , i = 0 , 1 , , L 1 ,
where ξ l is the lth realization and N is the sample size (number of realizations). The value h depending on L specifies the histogram step.
The error of the histogram g ¯ n relative to the density g includes deterministic and stochastic components, and it is estimated from below by the value ε g L :
ε ¯ g L = g ν 1 , ν 2 g ¯ ν 1 , ν 2 L L 2 ( Ω ) ε g L .
The results of calculations using Formula (44) for both densities from Examples 1 and 2 are given in Table 5 and Table 6, respectively. They should be compared with the rows “∗” in Table 1 and Table 3. Such a comparison shows the undoubted advantage of projection density estimates using Legendre polynomials. The approximation accuracy when using block pulse functions for L = 64 corresponds to the approximation accuracy when using Legendre polynomials for n = 8 in Example 1 and for n = 4 in Example 2. If the number of block pulse functions L is doubled, then the deterministic component of error decreases by approximately 2 times, and this conclusion does not depend on the degree of smoothness of the estimated density.
The problem of the conditional optimization of the algorithm for obtaining the histogram was solved in [1]. In this problem, optimal parameters satisfy the relationship N opt L opt 3 which corresponds to inequality (42). A generalization of this result in the context of stochastic differential equations can be found in [3]. Choosing parameters in this way, the computational error ε ¯ g L will be approximately twice as large as its deterministic component ε g L , since the conditional optimization of the algorithm for obtaining the histogram assumes the equalization of deterministic and stochastic components.
For densities from Examples 1 and 2, to reduce the approximation error using the histogram by 2 times, it is necessary to increase the number of block pulse functions L by 2 times and the sample size N by 2 3 = 8 times. The projection estimates of densities using Legendre polynomials are more effective in these examples. To reduce the approximation error by 2 times in Example 1, it suffices to increase the projection expansion length n by 2 2 / 3 1.587 times and the sample size N by ( 2 2 / 3 ) 4 = 2 8 / 3 6.350 times. In Example 2, it suffices to increase the projection expansion length n by 2 2 / 5 1.320 times and the sample size N by ( 2 2 / 5 ) 6 = 2 12 / 5 5.278 times. In this case, increasing n and N implies their subsequent rounding-up.

8. Conclusions

A distinctive feature of the algorithms proposed in this paper is the jointly obtaining of the projection estimates of the density and distribution function of a random variable. In addition, the problem of the conditional optimization of the algorithms is solved under the assumption that the estimated functions belong to the Sobolev–Slobodetskij space. This assumption allows one to use a more precise estimate of the convergence rate for projection expansions compared with the case where the ordinary Sobolev space or the space of continuously differentiable functions are used. Numerical experiments confirm the obtained theoretical results.
The proposed algorithms and conditionally optimal relationships between parameters ensure the minimum complexity when obtaining projection estimates to achieve the required approximation accuracy. These algorithms are important for studying the properties of solutions to stochastic differential equations [28,29], including stochastic differential equations with a Poisson component [6,30] or with the switching right-hand side [31,32].

Author Contributions

Conceptualization, T.A. and K.R.; methodology, T.A. and K.R.; software, K.R.; validation, T.A.; formal analysis, T.A. and K.R.; writing—original draft preparation, T.A. and K.R.; writing—review and editing, T.A. and K.R.; visualization, K.R.; funding acquisition, T.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research study was carried out within the framework of the state assignment to the Institute of Computational Mathematics and Mathematical Geophysics of the Siberian Branch of the Russian Academy of Sciences (project FWNM-2025-0002).

Data Availability Statement

The source code is available at https://github.com/rkoffice/estimation (accessed on 22 July 2025).

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Chentsov, N.N. A bound for an unknown distribution density in terms of the observations. In Doklady Akademii Nauk; Russian Academy of Sciences: Moscow, USSR, 1962; Volume 147, pp. 45–48. [Google Scholar]
  2. Mikhailov, G.A. Randomized Monte Carlo algorithms for problems with random parameters (“Double randomization” method). Numer. Anal. Appl. 2019, 12, 155–165. [Google Scholar] [CrossRef]
  3. Averina, T. Conditional optimization of algorithms for estimating distributions of solutions to stochastic differential equations. Mathematics 2024, 12, 586. [Google Scholar] [CrossRef]
  4. Averina, T.A.; Rybakov, K.A. Solving approximately a prediction problem for stochastic jump-diffusion systems. Numer. Anal. Appl. 2017, 10, 1–10. [Google Scholar] [CrossRef]
  5. Rudenko, E.A. Operational absolutely optimal dynamic control of the stochastic differential plant’s state by its output. J. Comput. Syst. Sci. Int. 2023, 62, 233–247. [Google Scholar] [CrossRef]
  6. Averina, T.A.; Rybakov, K.A. Using maximum cross section method for filtering jump-diffusion random processes. Russ. J. Numer. Anal. Math. Model. 2020, 35, 55–67. [Google Scholar] [CrossRef]
  7. Panteleev, A.; Karane, M. Application of a novel multi-agent optimization algorithm based on PID controllers in stochastic control problems. Mathematics 2023, 11, 2903. [Google Scholar] [CrossRef]
  8. Mikhailov, G.A. Weighted Monte Carlo Methods; Siberian Branch of the Russian Academy of Sciences: Novosibirsk, Russia, 2000. [Google Scholar]
  9. Suetin, P.K. Classical Orthogonal Polynomials; Nauka: Moscow, USSR, 1979. [Google Scholar]
  10. Triebel, H. Theory of Function Spaces; Birkhäuser: Basel, Switzerland, 2010. [Google Scholar]
  11. Canuto, C.; Hussaini, M.Y.; Quarteroni, A.; Zang, T.A. Spectral Methods. Fundamentals in Single Domains; Springer: Berlin/Heidelberg, Germany, 2006. [Google Scholar]
  12. Schwab, C. p- and hp- Finite Element Methods: Theory and Applications in Solid and Fluid Mechanics; Oxford University Press: Oxford, UK, 1998. [Google Scholar]
  13. Houston, P.; Schwab, C.; Süli, E. Discontinuous hp-finite element methods for advection-diffusion-reaction problems. SIAM J. Numer. Anal. 2002, 39, 2133–2163. [Google Scholar] [CrossRef]
  14. Canuto, C.; Quarteroni, A. Approximation results for orthogonal polynomials in Sobolev spaces. Math. Comput. 1982, 38, 67–86. [Google Scholar] [CrossRef]
  15. Agranovich, M.S. Sobolev Spaces, Their Generalizations and Elliptic Problems in Smooth and Lipschitz Domains; Springer: Cham, Switzerland, 2015. [Google Scholar]
  16. Slobodetskij, L.N. SL Sobolev’s spaces of fractional order and their application to boundary problems for partial differential equations. In Doklady Akademii Nauk; Russian Academy of Sciences: Moscow, USSR, 1958; Volume 118, pp. 243–246. [Google Scholar]
  17. Edmunds, D.E.; Evans, W.D. Fractional Sobolev Spaces and Inequalities; Cambridge University Press: Cambridge, UK, 2023. [Google Scholar]
  18. Cramér, H. Mathematical Methods of Statistics; Princeton University Press: Princeton, NJ, USA, 1999. [Google Scholar]
  19. Chentsov, N.N. Statistical Decision Rules and Optimal Inference; American Mathematical Society: Providence, RI, USA, 1982. [Google Scholar]
  20. Ibragimov, I.A. A generalization of N. N. Chentsov’s projection estimates. J. Math. Sci. 2015, 204, 116–133. [Google Scholar] [CrossRef]
  21. Gikhman, I.I.; Skorokhod, A.V. Introduction to the Theory of Random Processes; Dover Publications: New York, NY, USA, 1997. [Google Scholar]
  22. Mikhailov, G.A.; Voitishek, A.V. Numerical Statistical Modeling. Monte Carlo Methods; Academia: Moscow, Russia, 2006. [Google Scholar]
  23. Korn, G.A.; Korn, T.M. Mathematical Handbook for Scientists and Engineers; Dover Publications: New York, NY, USA, 2000. [Google Scholar]
  24. Fichtenholz, G.M. Course of Differential and Integral Calculus; Fizmatlit: Moscow, Russia, 2006; Volume 2. [Google Scholar]
  25. Rybakov, K. Spectral representation and simulation of fractional Brownian motion. Computation 2025, 13, 19. [Google Scholar] [CrossRef]
  26. Golubov, B.; Efimov, A.; Skvortsov, V. Walsh Series and Transforms: Theory and Applications; Kluwer Academic Publishers: Dordrecht, The Netherlands, 1991. [Google Scholar]
  27. Marchouk, G.; Agochkov, V. Introduction aux Méthodes des Éléments Finis; Éditions Mir: Moscow, USSR, 1986. [Google Scholar]
  28. Averina, T.A.; Rybakov, K.A. Rosenbrock-type methods for solving stochastic differential equations. Numer. Anal. Appl. 2024, 17, 99–115. [Google Scholar] [CrossRef]
  29. Giordano, C. A deterministic-stochastic hybrid integrator for random ordinary differential equations with aerospace applications. Aerospace 2025, 12, 397. [Google Scholar] [CrossRef]
  30. Song, Y.; Wu, Z. The maximum principle for stochastic control problem with jumps in progressive structure. J. Optim. Theory Appl. 2023, 199, 415–438. [Google Scholar] [CrossRef]
  31. Averina, T.A.; Rybakov, K.A. Comparison of a statistical simulation method and a spectral method for analysis of stochastic multistructure systems with distributed transitions. Russ. J. Numer. Anal. Math. Model. 2007, 22, 431–447. [Google Scholar] [CrossRef]
  32. Borisov, A. Regime tracking in markets with Markov switching. Mathematics 2024, 12, 423. [Google Scholar] [CrossRef]
Figure 1. The approximation errors for densities (the left part for g 1 , 2 from Example 1 and the right part for g 3 , 2 from Example 2).
Figure 1. The approximation errors for densities (the left part for g 1 , 2 from Example 1 and the right part for g 3 , 2 from Example 2).
Algorithms 18 00466 g001
Table 1. The approximation errors ε g n (in the row “∗”) and ε ¯ g n (in the remaining rows) for sample sizes N = 2 m + 9 (Example 1).
Table 1. The approximation errors ε g n (in the row “∗”) and ε ¯ g n (in the remaining rows) for sample sizes N = 2 m + 9 (Example 1).
m n = 4 n = 8 n = 16 n = 32 n = 64
0.0246140.0098000.0038380.0014420.000527
00.0653000.0686250.1197840.1680440.209996
10.0299990.0208670.0643030.1072750.144097
20.0263600.0310220.0460080.0617320.093907
30.0351170.0288620.0366850.0453020.064636
40.0286030.0202360.0268960.0350320.050834
50.0258790.0153050.0184050.0256550.034847
60.0258670.0144010.0140680.0172830.023956
70.0260840.0158070.0147620.0172450.021088
80.0248140.0114650.0085500.0108500.015997
90.0246400.0100350.0055340.0069070.010124
100.0246380.0099760.0049250.0051210.007505
110.0246220.0098880.0043520.0032110.005116
120.0246160.0098150.0041120.0024610.003081
130.0246160.0098140.0039370.0020640.002367
140.0246160.0098070.0038810.0018130.001689
150.0246150.0098020.0038520.0016230.001308
160.0246150.0098030.0038510.0015530.001093
170.0246150.0098020.0038520.0015030.000830
180.0246150.0098010.0038450.0014700.000647
Table 2. The approximation errors ε f n (in the row “∗”) and ε ¯ f n (in the remaining rows) for sample sizes N = 2 m + 9 (Example 1).
Table 2. The approximation errors ε f n (in the row “∗”) and ε ¯ f n (in the remaining rows) for sample sizes N = 2 m + 9 (Example 1).
m n = 4 n = 8 n = 16 n = 32 n = 64
0.0057720.0010690.0001980.000036 6.48 · 10 6
00.0273510.0269350.0277690.0281430.028244
10.0108170.0092870.0101890.0106210.010828
20.0060600.0041980.0047440.0050010.005172
30.0086350.0070380.0071790.0072550.007313
40.0066670.0040180.0041660.0042340.004284
50.0061490.0027460.0026800.0027540.002788
60.0061590.0026660.0025190.0025440.002561
70.0061860.0027220.0025710.0025940.002604
80.0058450.0015190.0011600.0011820.001205
90.0057840.0011520.0005350.0005390.000558
100.0058010.0012300.0006610.0006470.000656
110.0057830.0011400.0004490.0004110.000420
120.0057730.0010810.0002630.0001830.000186
130.0057750.0010870.0002820.0002100.000209
140.0057730.0010800.0002500.0001610.000158
150.0057720.0010700.0002020.0000600.000051
160.0057720.0010720.0002120.0000860.000079
170.0057720.0010710.0002080.0000750.000067
180.0057720.0010700.0002000.0000460.000030
Table 3. The approximation errors ε g n (in the row “∗”) and ε ¯ g n (in the remaining rows) for sample sizes N = 2 m + 9 (Example 2).
Table 3. The approximation errors ε g n (in the row “∗”) and ε ¯ g n (in the remaining rows) for sample sizes N = 2 m + 9 (Example 2).
m n = 4 n = 8 n = 16 n = 32 n = 64
0.0097570.0017820.0003270.0000590.000011
00.0952130.0962790.1100030.1631120.202505
10.0690750.0725950.0774030.1016390.156190
20.0371890.0422720.0555800.0750760.109453
30.0199120.0201480.0280460.0445670.077312
40.0154450.0157960.0188720.0353100.052812
50.0107990.0074780.0147300.0215910.037072
60.0112920.0076150.0104090.0138760.026574
70.0125270.0090470.0114260.0136970.021402
80.0102210.0048890.0066110.0085140.014083
90.0099190.0026190.0033590.0048790.008398
100.0098510.0023470.0030530.0041970.005689
110.0097790.0022550.0018180.0023580.003913
120.0097830.0023290.0017880.0019990.003051
130.0097660.0019680.0012110.0015800.002321
140.0097690.0019110.0009600.0011760.001615
150.0097610.0018390.0007980.0007780.001129
160.0097570.0017930.0004720.0004550.000766
170.0097570.0017890.0004090.0004250.000553
180.0097580.0017890.0003820.0002980.000388
Table 4. The approximation errors ε f n (in the row “∗”) and ε ¯ f n (in the remaining rows) for sample sizes N = 2 m + 9 (Example 2).
Table 4. The approximation errors ε f n (in the row “∗”) and ε ¯ f n (in the remaining rows) for sample sizes N = 2 m + 9 (Example 2).
m n = 4 n = 8 n = 16 n = 32 n = 64
0.0027790.0001390.000014 1.40 · 10 6 1.35 · 10 7
00.0500420.0500770.0501780.0503380.050393
10.0321340.0324490.0324740.0325680.032637
20.0206940.0206490.0207790.0208540.020905
30.0107290.0104450.0105130.0105770.010651
40.0072910.0068540.0068900.0069800.007017
50.0039140.0028280.0029460.0030020.003052
60.0039840.0029330.0029820.0029990.003031
70.0049230.0041300.0041600.0041690.004182
80.0033040.0018420.0018720.0018790.001893
90.0029040.0008660.0008740.0008830.000893
100.0028030.0004140.0004390.0004540.000460
110.0027900.0003220.0003010.0003060.000311
120.0027920.0003410.0003200.0003220.000325
130.0027820.0002080.0001670.0001710.000174
140.0027830.0002150.0001690.0001700.000171
150.0027800.0001710.0001080.0001070.000108
160.0027790.0001470.0000530.0000520.000053
170.0027790.0001440.0000430.0000430.000043
180.0027800.0001580.0000760.0000750.000075
Table 5. The approximation error ε g L (Example 1).
Table 5. The approximation error ε g L (Example 1).
n = 4 n = 8 n = 16 n = 32 n = 64
0.1862630.0941530.0472030.0236180.011811
Table 6. The approximation error ε g L (Example 2).
Table 6. The approximation error ε g L (Example 2).
n = 4 n = 8 n = 16 n = 32 n = 64
0.1713050.0890380.0449450.0225260.011270
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Averina, T.; Rybakov, K. Analysis and Conditional Optimization of Projection Estimates for Distribution of Random Variable Using Legendre Polynomials. Algorithms 2025, 18, 466. https://doi.org/10.3390/a18080466

AMA Style

Averina T, Rybakov K. Analysis and Conditional Optimization of Projection Estimates for Distribution of Random Variable Using Legendre Polynomials. Algorithms. 2025; 18(8):466. https://doi.org/10.3390/a18080466

Chicago/Turabian Style

Averina, Tatyana, and Konstantin Rybakov. 2025. "Analysis and Conditional Optimization of Projection Estimates for Distribution of Random Variable Using Legendre Polynomials" Algorithms 18, no. 8: 466. https://doi.org/10.3390/a18080466

APA Style

Averina, T., & Rybakov, K. (2025). Analysis and Conditional Optimization of Projection Estimates for Distribution of Random Variable Using Legendre Polynomials. Algorithms, 18(8), 466. https://doi.org/10.3390/a18080466

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop