Comparative analysis of methods for calculating the mode of a stationary random process

The paper considers methods for calculating the mode of a stationary random process when solving the problem of processing measurement results under conditions of a priori uncertainty. The results of the conducted studies allowed us to conclude that the most effective method for calculating the mode for a given sample is the proposed method, which allows to increase the accuracy of its calculation by at least 8 times, compared to methods based on the construction of histograms. It should be noted that the proposed method allows to provide an estimate with an error of at least 5% for samples with a number of measurements of about 5 value.


Introduction
Currently, when processing random stationary processes, in some cases, it is necessary to calculate the mode of a random process. One example of such a need is the use of the method of multiplying estimates (RAZOTS) when processing measurement results under conditions of a priori uncertainty [1][2][3]. As follows from the analysis of the research results presented in the paper [4,5], the distribution of the error in each of the cross sections of the multiplication set of the original sample is assumed according to the normal law. However, a more detailed analysis of the research results showed that the error distribution at the beginning and end of the sample differs significantly from the normal one and approaches the Rayleigh distribution. It is known that under the Rayleigh distribution law, the values of the mode and the mean are already significantly different compared to the normal law, where they are equal. This difference is the source of the increase in the error of processing the measurement results, which can be reduced by calculating not the average, but the mode in each of the cross-sections of processing the measurement results. Keeping in mind that a mode is understood as the value of a random variable, the probability of which is maximal.
Thus, replacing the mean with the mode will significantly increase the accuracy of processing the measurement results. This task is very urgent and practically significant.

Methods and materials
Suppose that we are given a sample of a random stationary process distributed according to Rayleigh's law ( ) = 2 − 2 2 2 ; y ≥ 0. (1) The algorithm for modeling random numbers distributed according to Rayleigh's law, according to the work [6] it can be described by the following expression where -a random variable evenly distributed in the interval [0,1]. Various methods can be used to estimate the mode value, including the value calculated from the analytical expression of the Rayleigh distribution law, which is equal to the derivative of the expression (1), and it is equal to zero. The calculation shows that the mode value is equal to the value σ. The second well -known method [7][8][9] for calculating the mode by estimating the differential density of the distribution is histograms. And here we can distinguish three approaches for calculating the mode. 1build a histogram and estimate the range of values that have the maximum value, take the extreme values of the interval, average and consider this value as a mode. 2determine the interval that has the maximum value, select all the values of the random process that fall into this interval and build a new histogram based on these values. determine the maximum interval, average it by the extreme values, and consider it a mode. It is known from the literature [10][11][12][13][14][15][16][17][18][19][20] that in order to find the mode, you need to find the modal interval and use the following formula: where 0 − lower limit of the modal interval; ℎ − length of the modal interval; -frequency of the modal interval; −1 -frequency of the previous interval; +1 -frequency of the next interval. As follows from the above, the modal interval method is also based on the construction of a histogram, which significantly complicates the calculations, especially when the sample size is limited. In this regard, the following method of determining the mode from the sample itself without constructing a histogram, proposed by the authors of this work, is of considerable interest.
Let's assume that for a random variable X, distributed according to Rayleigh's law, the implementation of the sample was obtained x 1 , x 2 , … , x n . We find an estimate of the maximum likelihood of the parameter σ of this distribution.
It is known that, its density is different from zero only on the interval (0, +∞), with Therefore, the likelihood function in this case has the form we get the equation − 2 = 0. From its two roots = ±√ we choose the positive one * = √ . Since the function is positive (ln ( )) ′ on the interval (0; * ) and is negativ at > * , it can be argued that * epresents the maximum likelihood estimate of the parameter . Note that the Rayleigh distribution mode is equal to ; this is easily verified by equating ′ ( ). to zero, Thus, the value of * = √ 1 2 ∑ 2 =1 (7) is also an estimate of the maximum likelihood of its mode.
So, the work considers four practical methods for calculating the mode of a random process that has a Rayleigh distribution law. We will conduct research on a comparative analysis of their effectiveness in order to obtain recommendations for their practical use. During the research, the mode estimation was carried out on a sample size of N samples by 100, 500, 1000, 2000 and 10000 repetitions. In this case, the estimation of the mode was the mathematical expectation over all realizations. This approach allows not only to obtain an estimate of the mean value, but also the spread of the values of the estimate of the mode relative to the simulated samples. The results of the research are presented in Figure 1.

Results and discussion
The analysis of the presented results shows that the accuracy of the mode estimation for each method is different. In Figure 1 proposed method possesses the smallest error, with 1000 repetitions, the error of this method for curve 2 is 0.43%, for curve 3 is 1.4%, for curve 4 is 8% and finally for 5 is 7.6%. It should be noted that the variation of values for each of the methods differs, for example, for 2 curves -about 5%, for 3-about 27%, for 4-about 20% and for 5-about 26%. From the above studies, we can conclude that the proposed method has not only the best accuracy, but also the smallest variation of values depending on the specific values in the sample.
In conclusion, let us consider the dependence of the mode estimation error on the sample length for the proposed method, which are presented in Figure 2. The results are presented for processing 1000 realizations of length N, which varies from 5,10,20,30,50 and 70. The results obtained fully confirm the previously obtained results, even with small samples N = 5, the error does not exceed 5%. Thus, on the basis of the studies carried out, we can recommend expression 7 for calculating the mode in practice, which makes it possible to provide an estimate of the mode with a minimum error for almost any sample of a random process.

1.
A new method for calculating the mode of a random process, which is distributed according to Rayleigh's law, is proposed. 2. The conducted research shows a high efficiency using the proposed method, with a calculation error within 0.43%, which is 8 times less than the most commonly used modal interval method.