# Nonparametric Probability Density Function Estimation Using the Pade Approximation
## 3 The Pade Approximation Using _Artificial_ Samples  
Many branches of science have invoked the Pade approximation as a tool to convert a series into a rational function. Similarly, in our study, we have applied it indirectly to samples to approximate an unknown PDF. The previously discussed method estimated \(f(x)\) using the Pade approximation. However, its accuracy decreases significantly as \(x\to 0\), causing distortion in that portion of the PDF. Moreover, all the samples in the previous method must be positive. To resolve this, we propose to utilize two datasets. The first is the given dataset. Thereafter, we create a new dataset from the original one, and the two of them will simultaneously be utilized to solve the problem. Suppose a given sample is randomly distributed from an unknown distribution \(f(x)\) (Equation (18)). We then generate \(N\) samples from \(R_{n}\) by mirroring \(R_{n}\) across the y-axis, creating the series \(L_{n}\):  
\[R_{n}=\{x_{1},x_{2},\ldots,x_{N}\}. \tag{18}\]  
\[L_{n}=\{-x_{1},-x_{2},\ldots,-x_{N}\}. \tag{19}\]  
As illustrated in Equation (19), all elements of the \(L_{n}\) series will be mirrored values of \(R_{n}\). Consequently, the estimated PDF using the \(L_{n}\) dataset, denoted as \(l(x)\), is precisely the reflection of our PDF function, \(f(x)\), across the negative Y-axis. To address the weakness of the one-point Pade approximation, in the following we will estimate the left part of \(f(x)\) using the right part \(l(x)\). Consequently, we estimate the right part of \(f(x)\) with the help of \(R_{n}\), leading to a more accurate estimation of the function. Now, to calculate \(l(x)\) from \(L_{n}\), we follow the same procedure. To implement the one-sided Laplace transform, firstly, we need non-zero integer samples. Therefore, we shift all elements of \(L_{n}\) by the maximum amount of the \(L_{n}\) series \(+\) 1, which is \(\beta+1\):  
\[L_{n}=\{-x_{1}+\beta+1,\ldots,-x_{N}+\beta+1\}. \tag{20}\]  
Proceeding now from Equation (3):  
\[E((-x+\beta+1)^{n+1})=\frac{1}{N}\sum_{n=0}^{N}(-x+\beta+1)^{n}\quad\hat{x}=- x+\beta+1\quad\hat{M}_{n}=\frac{1}{N}\sum_{n=0}^{N}(\hat{x})^{n}. \tag{21}\]  
\(\hat{M}_{n}\) is the moment generating function of our new training samples. So we continue:  
\[l(u)=\sum_{n=0}^{\infty}\hat{M}_{n}\bigg{(}\frac{(-u)^{n}}{n!}\bigg{)} \longrightarrow\hat{P}_{D}^{L}(u)=\frac{\sum_{n=0}^{L}a_{n}u^{n}}{1+\sum_{n= 1}^{D}b_{n}u^{n}}=\sum_{i=1}^{D}\frac{\hat{\lambda}_{i}}{u+\hat{p}_{i}}. \tag{22}\]  
\[L^{-1}(\hat{P}_{D}^{L}(u))=l(\hat{x})=\sum_{i=1}^{M}\hat{\lambda}_{i}e^{-\hat {p}_{i}\hat{x}},\quad\hat{p}_{i}>0. \tag{23}\]  
It is easy to see that \(l(\hat{x})\) is the mirrored form of our desired PDF. However, due to the use of the Pade approximation, this estimation suffers from the same issue we discussed before: it is only reliable when \(\hat{x}\) is sufficiently large. Now, our objective is to utilize the right side of \(l(\hat{x})\) to replace the distorted part of \(f(x)\). To achieve this, we need to roll back the entire shifting process. Considering Equation (19) and then combining Equation (21) and Equation (15), we have:  
\[x=-\hat{x}+\beta+1\implies\hat{x}=-x+\beta+1. \tag{24}\]  
The estimated PDF \(\hat{f}(x)\) is given by:  
\[l(x)= \begin{cases}l(-x+\beta+1),&\text{if }x\to 0\\ r(x),&\text{if }x\to\infty.\end{cases}  \tag{25}\]  
\(R(x)\) is the estimation of the series \(R_{n}\). An acceptable point \(C\) is required to be considered as the \"centroid\" for combining these two functions. The final result is equal to:  
\[g(x)= \begin{cases}\frac{l(x)}{\int_{C}^{\infty}\left(l(x)+\int_{C}^{\infty}r(- x+m)\,dx\right)},&\text{if }x>C;\\ f(-x+m),&\text{if }x<C.\end{cases}  \tag{26}\]  
The denominators of sub-equations are necessary to ensure that the integral of \(g(x)\) is equal to unity. Selecting the best value for \(C\) is one of the challenges that should be taken into account. In this paper, we select the mean of \(X_{n}\) because it yields good experimental results.