# A Matrix Effect Correction Method for Portable X-ray Fluorescence Data
## 2 Materials and Methods
### Correction Method for the Matrix Effect  
According to the Sherman equation (Equation (1)), which describes the relationship between the measured intensities emitted by a sample and its composition [21; 22], the pXRF analysis result of an element is affected by all the other elements in a sample:  
\[I_{j}=f\left(C_{j},C_{k},\ldots,C_{m}\right) \tag{1}\]  
where \(I_{j}\) is the net intensity of element \(j\), \(C_{j}\) is the concentration of element \(j\) and \(C_{k}\)-\(C_{m}\) are the concentrations of other elements.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Lithology** & **Number** & **Sample No.** \\ \hline Rock & 10 & GBW07104, GBW07105, GBW07106, GBW07107, GBW07122, \\  & & GBW07162, GBW07163, GBW07165, GBW07825, ZBK336 \\ Soil & 6 & GBW07401, GBW07403, GBW07404, GBW07405, GBW07406, GBW07408 \\ \hline \hline \end{tabular} Note: These samples were provided by the Institute of Geophysical and Geochemical Exploration of the Chinese Academy of Geological Science.  
\end{table}
Table 1: Certified reference samples for pXRF analysis.  
However, not all elements can be determined by pXRF analysis due to the low detection limits of some elements [23]. In addition, this equation is not reversible for calculating unknown sample compositions. At present, the commonly used correction method is the regression method. Note that major components of a sample contribute most to the matrix effect and therefore should be considered important indicators in matrix effect correction, such as Si, Al, Fe, Ca, K, Mn and Ti. As a result, major elements were added as an independent variable into the commonly used SLR model, and then a multiple linear regression equation (Equation (2)) could be established [11]:  
\[C_{i}^{\prime}=\alpha_{i}C_{i}+\alpha_{j}C_{j}+u_{i} \tag{2}\]  
where C\({}_{i}^{\prime}\) is the reference value of element \(i\), \(C_{i}\) and C\({}_{j}\) are the pXRF testing values of element \(i\) and major element \(j\) that is most closely related to element \(i\), respectively, \(\alpha_{i}\) is the regression coefficient of element \(i\), \(\alpha_{j}\) is the influence coefficient of major element \(j\) to element \(i\) and \(u_{i}\) is the regression intercept of element \(i\).  
The values of \(\alpha_{i}\), \(\alpha_{j}\) and \(u_{i}\) are affected by the instrument conditions and can be calculated by testing the CRMs. In this process, the ordinary least squares approach [24; 25], which is one the most popular chemometric algorithms for calibration model creation, is used. Similarly, this method requires minimizing the sum of the squares of the residuals. As a result, \(\alpha_{i}\), \(\alpha_{j}\) and \(u_{i}\) can be obtained by solving Equations (3)-(5):  
\[\alpha_{i}=\frac{\left(\sum_{k=1}^{n}M_{ik}^{\prime}M_{ik}\right)\left(\sum_{ k=1}^{n}M_{jk}^{2}\right)-\left(\sum_{k=1}^{n}M_{ik}^{\prime}M_{jk}\right) \left(\sum_{k=1}^{n}M_{ik}M_{jk}\right)}{\left(\sum_{k=1}^{n}C_{ik}^{2}\right) \left(\sum_{k=1}^{n}C_{jk}\right)-\left(\sum_{k=1}^{n}C_{ik}C_{jk}\right)^{2}} \tag{3}\]  
\[\alpha_{j}=\frac{\left(\sum_{k=1}^{n}M_{ik}^{\prime}M_{jk}\right)\left(\sum_{ k=1}^{n}M_{ik}^{2}\right)-\left(\sum_{k=1}^{n}M_{ik}^{\prime}M_{ik}\right) \left(\sum_{k=1}^{n}M_{ik}M_{jk}\right)}{\left(\sum_{k=1}^{n}C_{ik}^{2}\right) \left(\sum_{k=1}^{n}C_{jk}\right)-\left(\sum_{k=1}^{n}C_{ik}C_{jk}\right)^{2}} \tag{4}\]  
\[u_{i}=\frac{\left(\sum_{k=1}^{n}C_{ik}^{\prime}\right)-\alpha_{i}(\sum_{k=1}^ {n}C_{ik})-\alpha_{j}\left(\sum_{k=1}^{n}C_{jk}\right)}{k} \tag{5}\]  
where \(n\) is the number of samples and \(C_{ik}\) and \(C_{jk}\) are the testing values of elements \(i\) and \(j\) in sample \(k\), respectively. The testing values of \(i\) and \(j\) are zero centered to \(M_{ik}\) and \(M_{jk}\) by the following equation. \(M_{ik}^{\prime}\) and \(C_{ik}^{\prime}\) are the transposes of \(M_{ik}\) and \(C_{ik}\), respectively:  
\[M_{ik}=C_{ik}-\frac{\sum_{k=1}^{n}C_{ik}}{k} \tag{6}\]  
\[M_{ij}=C_{jk}-\frac{\sum_{k=1}^{n}C_{jk}}{k} \tag{7}\]