**Algorithm 2:** Fault Diagnosis Method Based on Optimal KDE

**Input:** Training data: *R*1, *R*2, ··· , *R<sup>p</sup>* ; Significance level: *α*; Testing data: *Z* = [*z*1, *z*2,..., *zl*].

**Output:** Pattern classification labels for testing data *Z*.


**Figure 2.** Flowchart of fault diagnosis method based on optimal KDE.

**Remark 3.** *Equations (54) and (55) show that the calculation result of JS divergence is directly related to the length of sampling data. Indeed, with the increase in the sampling data length, the density estimation obtained by Equation (54) can describe the distribution characteristics of samples more effectively, thereby significantly improving the accuracy of fault detection.*

#### **5. Numerical Simulation**

The bearing data from Case Western Reserve University Bearing Data Center were used as the diagnosis research object, and they have been considered as a case for many fault diagnosis, such as in references Smith and Randall [21], Lou and Loparo [22], Rai and Mohanty [23].

The sampling frequency of the motor data was 12 kHz, and 12 kHz is the default sampling frequency for Case Western Reserve University Bearing Data Center. The dataset contains four groups of sample data: normal data (*f*0), 0.007 inch inner raceway fault data (*f*1), 0.014 inch inner raceway fault data (*f*2), and 0.014 inch outer raceway fault data(*f*3). Each group of data had two dimensions: the acceleration data of the drive end (*fi* − *DE*) and the acceleration data of the fan end (*fi* − *FE*). All the experiments were conducted on an Lenovo Ryzen 3700X CPU with 3.60 GHz processor, 16 GB RAM.
