## 3 Material and Methods
### Structure of the Path-GMM-Nearest-Neighbor Model
\begin{cases}\omega_{kK}\geq 0&for\ 1\leq k\leq K\\ \omega_{kK}=0&for\ k>K\\ \quad\text{and}&\sum_{k=1}^{K}\omega_{kK}=1\end{cases}  \tag{7}\]  
From Equation (7), it can be seen that the integer \(K\leq n\) represents the number of nearest neighbors for observation \(i\). Let \(W_{ii}=0\) and the sequence of observations \(j\
eq i\) according to the distance mentioned above. Then, let the weight \(W_{ij}=\omega_{jK}\) correspond to the observation with the smallest distance \(j^{th}\), \(\big{\|}X_{i}-X_{j}\big{\|}_{n}\). An example is shown: the same weight \(\omega_{kK}=1/K,k\leq K\) is used to calculate the conditional expectation of \(y\). Let \(X\) be the selected set of \(K\) (from a total of \(n\)), closest to \(X_{i}\), moving towards point \(X\). The average value of \(Y_{i}\) corresponding to the selected characteristics of \(X_{i}\) is calculated as estimated above [15; 16; 17; 18; 61; 62]. \[E(Y|X)=\sum_{k=1}^{K}\omega_{kK}Y_{k}^{*}(X)=\frac{1}{K}\sum_{k=1}^{K}Y_{k}^{*} (X) \tag{8}\]  
Let \(Y_{k}^{*}(X)\) be the same variable as \(Y_{i}\), based on the distance indicator mentioned \(Y_{i}\) above (\(Y_{1}^{*}\) is \(Y_{i}\), which has the closest value to \(X_{i}\), \(X\), and \(Y_{2}^{*}\) is the second closest value, etc.). However, for other possibilities, the estimator \(k-NN\) with different weights can be used, as shown in the estimator below:  
\[E(Y|X)=\sum_{j=1}^{n}\omega_{j}Y_{j}^{*}(X) \tag{9}\]From Equation (9), the weights are as follows:  
\[\omega_{j}^{T}= \begin{cases}2(K-j+1)/[K(K+1)]&\text{for}\quad j<K\\ 0&\text{for}\quad j\geq K\end{cases}  \tag{10}\]  
From Equation (10), the weights of the quadratic equation are as follows:  
\[\omega_{j}^{Q}= \begin{cases}6\Big{[}K^{2}(j-1)^{2}\Big{]}\,/\big{[}K(K+1)(4K-1) \big{]}&\text{for}\quad j<K\\ 0&\text{for}\quad j\geq K\end{cases}  \tag{11}\]  
Therefore, in this research, the most suitable and appropriate tool for estimation has been selected. For the nearest neighbor estimator, the conditional covariance \(\Omega(X_{i})\) is where \(X_{i}\) is:  
\[\Omega(X_{i})=\sum_{j=1}^{n}W_{ij}\rho(z_{j},\hat{\theta})\rho(z_{j},\hat{ \theta})^{\prime} \tag{12}\]  
From Equation (12), it can be seen that observation i is not considered jointly because of \(W_{ii}=0\) (the leave-one-out principle). The nonparametric estimation of \(D(X)\) is consistent with: [62]  
\[\hat{D}(X_{i})=\sum_{j=1}^{n}W_{ij}\frac{\partial\rho\big{(}z_{j},\hat{\theta }\big{)}}{\partial\theta} \tag{13}\]  
From Equation (13), assume that some components of \(D(X)\) are known in terms of their working patterns and depend only on \(X\). The estimator will consist of both the parametric parameters and the nearest neighbor components. Let \(D(X,\eta)\) represent the function before specifying the function of \(X\), and the nuisance parameter \(\eta\), \(D(X,\eta)\) has the same dimensions as \(D(X)\), with the components of this variable being equal to those of the known \(D(X)\) and 0 otherwise. Therefore, the estimator will be: [61; 62]  
\[\hat{D}(X_{i})=D(X_{i},\hat{\eta})+\sum_{j=1}^{n}W_{ij}\Bigg{[}\frac{\partial \rho\big{(}z_{j},\hat{\eta}\big{)}}{\partial\theta}-D\big{(}X_{j},\hat{\eta} \big{)}\Bigg{]} \tag{14}\]  
From Equation (14), we can calculate as follows:  
\[\hat{B}(X_{i})=\hat{D}(X_{i})^{\prime}\hat{\Omega}(X_{i})^{-1},\ \Lambda= \Bigg{(}\frac{1}{n}\sum_{i=1}^{n}\hat{D}(X_{i})^{\prime}\hat{\Omega}(X_{i}) \hat{D}(X_{i})\Bigg{)} \tag{15}\]  
For this model, the white noise property was tested by assessing the performance using the Root Mean Squared Error (RMSE) and Mean Absolute Percentage Error (MAPE) statistics.