# Kernel Density Derivative Estimation of Euler Solutions
## 2 Materials and Methods
### Multivariate KDE of the Euler Solution Datasets
#### 2.2.1 Computational Algorithm for Multivariate KDE  
Calculating \(\
abla\overline{F}(\mathbf{x};\mathbf{H})\) on a given estimation grid \(\mathbf{\chi}\) by directly looping over the grid points and sample data points is time-consuming, especially for large \(n\) and/or \(\mathbf{M}\) values. To reduce the calculation burden, according to the algorithm of [PERSON] [80], the KDDE can be a computationally efficient approximation by using a fast linear binning approximation [81; 82]. Therefore, by supposing that \(\mathbf{X}_{i}\) falls into a hyper-rectangle (also called a bin) with \(2^{d}\) facets and \(2^{d}\) vertices, following [PERSON] and [PERSON] [77] and [PERSON] [80], the calculation process of Equation (6) is detailed with three steps. The first step is to convert the original sample data \(\mathbf{X}\) into _grid counts_ using a fast linear binning approximation. Comparing the natural coordinate's definition in [PERSON]'s book [83] with the grid count's definition in [PERSON] and [PERSON]'s book [76], the grid count at a gridpoint of the hyper-rectangle due to \(\mathbf{X}_{i}\) is equal to the value of the natural coordinate at the same grid point. Then, these counts are accumulated into a large matrix \(C\). Take univariate data (\(d=1\)) as an example, the hyper-rectangle (also called a bin) is a line segment with two endpoints \(\chi_{j_{1}}\) and \(\chi_{j_{1}+1}\). Then, suppose that the \(i\)th sample data \(\mathbf{X}_{i}\) is inside the line segment. Further, assume that the length of the bin is \(A\) and the length of the line segments, divided by \(\mathbf{X}_{i}\), are \(A_{1}\) and \(A_{2}\) as shown in Figure 1a. According to the natural coordinate's definition, the grid counts correspond to the two endpoints \(\mathbf{\chi}_{j_{1}}\) and \(\mathbf{\chi}_{j_{1}+1}\) are expressed as \(\overline{c}_{j_{1}}\) and \(\overline{c}_{j_{1}+1}\), respectively. Then the counts are defined as  
\[\overline{c}_{j_{1}}=A_{2}/A,\ \overline{c}_{j_{1}+1}=A_{1}/A \tag{8}\]  
To further illustrate the computational process of the multivariate KDDE in more detail, we focus on the bivariate case for the remainder of this section. Take a bivariable sample data (\(d=2\)) as an example, the hyper-rectangle/bin is a rectangle, as shown in Figure 1b. Then, suppose that the \(i\)th sample data \(\mathbf{X}_{i}\) falls into a hyper-rectangle/bin whose vertices are \(\mathbf{\chi}_{j_{1},j_{2}}\), \(\mathbf{\chi}_{j_{1}+1,j_{2}}\), \(\mathbf{\chi}_{j_{1}+1,j_{2}+1}\), and \(\mathbf{\chi}_{j_{1},j_{2}+1}\). The areas of the rectangles subtended  
Figure 1: Linear binning counts. (**a**) A univariate data \(\mathbf{X}_{i}\) is converted to the counts assigned to its 2 nearest grid points \(\mathbf{\chi}_{j}\) and \(\mathbf{\chi}_{j+1}\). Their respective counts are equal to the length of the opposite line segment divided by the total length of bin \(A\). (**b**) A bivariate data \(\mathbf{X}_{i}\) is converted to the counts assigned to its four nearest grid points. Following [PERSON]’s book [83] and [PERSON]’s book [76], their respective counts are equal to their natural coordinate value. Reprinted with permission from Ref. [76]. Copyright 2018 Taylor & Francis Group LLC. from \(\mathbf{X}_{i}\) are \(A_{1}\), \(A_{2}\), \(A_{3}\), and \(A_{4}\). The grid count is defined as the area of its diagonally opposite rectangle divided by the total area \(A\) of the bin. Thus,  
\[\left\{ \begin{array}{c}\overline{c}_{j_{1},j_{2}}=A_{3}/A\\ \overline{c}_{(j_{1}+1),j_{2}}=A_{4}/A\\ \overline{c}_{j_{1},(j_{2}+1)}=A_{2}/A\\ \overline{c}_{(j_{1}+1),(j_{2}+1)}=A_{1}/A\\ A_{1}+A_{2}+A_{3}+A_{4}=A\end{array} \right. \tag{9}\]  
By a similar process as above, extending it to the case of high-dimensional samples is easy. Then, the individual counts at the grid points are accumulated by looping this calculation over all sample data points.