Principal component analysis provides the most plausible low-rank approximation of data under, e.g., Gaussian noise (the Eckart-Young-Mirsky theorem ). However, EDX measurements usually have low X-ray counts, and it is useful to approximate the noise model using Poisson distribution. Following , introduced for secondary ion mass spectrometry data the weighted PCA (wPCA) to rescale count data before applying PCA. We apply wPCA to a STEM-EDX data M P R HˆW ˆC with the image height H, width W (in pixels), and C energy channels, as follows. The three-dimensional data is reshaped into a two-dimensional, data matrix M P R CˆN with N p" H ˆW q pixels, each column Mp:, nq P R C at the n-th pixel of which stores a counted EDX spectrum. The symbol : in the bracket denotes all of the elements in the index. In applying wPCA , we first convert the data into the equally scaled data as M " G ´1MH ´1, where G and H are diagonal matrices containing the square roots of the averaged image over energy and the averaged spectra over the image pixels, respectively. Letting the singular value Using the scaling factors G 1 and H 1 calculated from X ˚1, compute X˚1 " G 1´1 X ˚1H 1´1 and its singular value decomposition X˚1 " Ũ1 Σ1 Ṽ1J , and the denoised data is X ˚" G 1 Ũ1 p:, 1 : pq Σ1 p1 : p, 1 : pq Ṽ1 p:, 1 : pq J H 1 . Three circles-blue, red, and yellow-indicate points sampled from regions of Si, SiO2, and SiC. Spectra of these same colors indicate the spectra at these points: counts from the observed data, smoothed data, and the denoised data using wPCA, from left to right. decomposition (SVD) of the rescaled data be M " Ũ Σ ṼJ and the first p principal components span the true signals, we project M onto the low-dimensional subspace as X˚" Ũp:, 1 : pq Σp1 : p, 1 : pq Ṽp:, 1 : pq J . The symbol 1 : p in the brackets denotes the top p elements in each index. By rescaling back to the original scale of the signal intensity, we obtain a denoised data matrix X ˚" G X˚H of rank p.