# Nonparametric Probability Density Function Estimation Using the Pade Approximation
## 4 Using a Sigmoid-Based Transition  
When dealing with piecewise functions, abrupt transitions between segments can introduce discontinuities or undesirable behaviour. To achieve a smooth transition between two functions, we can use a sigmoid-based blending approach [31]. This method is particularly useful in scenarios where continuity and differentiability are important, such as in working with PDFs or control systems. The sigmoid function is defined as:  
\[\sigma(t,c,k)=\frac{1}{1+e^{-k(t-c)}}. \tag{32}\]  
The sigmoid function is defined as a smooth, continuous curve that transitions from 0 to 1. Here, \(t\) is the independent variable, \(c\) is the transition point, and \(k\) controls the steepness of the transition. The parameter \(k\) determines how sharply the curve transitions. For small values of \(k\), the transition is gradual, blending the functions smoothly over a wider range. For larger values of \(k\), the transition becomes sharper, closely approximating a step function at \(t=c\). To smoothly blend two functions, \(f_{1}(t)\) and \(f_{2}(t)\), around the transition point, \(c\), we define the blended function by Equation (33) as:  
\[f_{\text{blended}}(t,c,k)=f_{1}(t)\cdot(1-\sigma(t,c,k))+f_{2}(t)\cdot\sigma(t,c,k). \tag{33}\]  
This formulation ensures that as \(t\rightarrow-\infty\), \(\sigma(t,c,k)\to 0\), and the blended function approaches \(f_{1}(t)\). Similarly, as \(t\rightarrow\infty\), \(\sigma(t,c,k)\to 1\), and the blended function approaches \(f_{2}(t)\). Around \(t=c\), the two functions are smoothly combined based on the sigmoid weighting. The sigmoid-based transition is commonly used in various applications, such as in control systems, where it facilitates gradual shifts between control regimes, and signal processing, where it is employed for blending signals or applying gradual filters. This approach provides a robust mechanism for creating smooth, continuous transitions be  
Figure 2: The results of estimating the Gaussian density function are presented. The blue line represents the estimated PDF, while the red line depicts the true source density function. As observed, the left tail of the estimated PDF (**a**) and the right tail of the estimated PDF (**b**) exhibit inaccuracies. The final result, shown in (**c**), is the fused estimate with a discontinuity where the left and right estimated PDFs join. tween functions, enhancing both stability and interpretability in mathematical models. In our work, we used the sigmoid function for PDF reconstruction. This function ensures smooth transitions between the mirrored and original PDFs, effectively eliminating the discontinuity point. The result of applying the smoothing algorithm to the example from Section 3 is seen in Figure 3.  
To illustrate the proposed method within the broader context, Figure 4 presents a schematic diagram of the PA procedure. This figure outlines the sequential steps required to achieve an accurate approximation. Specifically, using Equation (33), we depict the final estimation obtained by combining the two estimations. In addressing the challenge of estimating the probability density function for negative random variables, we utilized a methodology involving horizontally shifting all samples to create a new dataset comprising only positive values. This positive dataset was then utilized to accurately approximate the probability density function. The process was initiated by aggregating all samples with a maximum absolute value, and subsequently, employing the same procedure outlined in Section 3 to estimate the PDF. In the final step, the samples were reverted to their original positions. To illustrate this procedure, consider the example in which \(S_{500}\) is a series of 500 samples randomly generated from a Gaussian distribution with a mean of zero and a variance of 20, i.e., \((N(0,20))\). In the first step, all the samples were transformed into positive samples by shifting by the Min(\(S_{1000}\)), such that they were strictly positive.