# Application of the Approximate Bayesian Computation Algorithm to Gamma-Ray Spectroscopy
## 5 Net Peak Area Extraction and ABC  
The net area of a peak can be estimated using a parametric or non-parametric approach. A parametric approach assumes an analytical function such as the\(f(E)\) in Equation (1). A nonparametric approach infers which energy bins belong to the peak region and uses a nearby background to estimate the background contribution to the gross peak count rate. Recall that some RIIDs use estimated peak location and area. For example, reference [7] described the potential for a Bayesian RIID and reference [8] implemented one version of a Bayesian RIID that relied on peak locations and areas. Reference [8] assumed that the likelihood could be expressed as a product of four terms:  
\[P(D|M)=\ f_{LPI}f_{DPI}f_{PP}f_{AR}. \tag{2}\]  
The term \(f_{LPI}\) quantifies how well model \(M\) matches expected library peaks, weighted by peak areas. Specifically, \(f_{LPI}=\prod\limits_{i=1}^{L}{(1-\theta_{LPI}\frac{A_{i}}{\max[A_{i}]}(1- \delta_{i})}\), where \(\delta_{i}=1\) if the \(i\)th library peak (of \(L\) library peaks) is found in the data, \(A_{i}\) is the estimated area of peak \(I\) and \(\theta_{LPI}\) is a parameter to control the magnitude of the penalty for library peaks that are not found in the data. For example, if model \(M\) is isotope 1 without any other radioisotopes and isotope 1 has \(K=3\) library peaks, all of which are found in the data, then \(f_{LPI}=1\). Similarly, \(f_{DPI}=\prod\limits_{i=1}^{D}{(1-\theta_{DPI}\frac{A_{i}}{\max[A_{i}]}(1- \delta_{i})}\) scores how well the \(D\) data peaks are matched in the \(L\) library peaks. The peak position score quantifies how closely the found peak is to the library peak, \(f_{PP}=\frac{1}{\sigma\sqrt{2n}}\exp{(\frac{-(E_{0}-E_{1})^{2}}{2\sigma^{2}} )}\) if \(\delta_{i}=1\) and \(f_{PP}=\theta_{PP}\) if \(\delta_{i}=0\). Allowing a nonzero value of \(\theta_{PP}\) was shown in [8] to perform better because it ensures that matched peaks lead to a larger likelihood than unmatched peaks. The area ratio \(f_{AR}\) quantifies how well the ratios of the data peak areas match the corresponding library peak ratios. Comparing area ratios rather than areas eliminates the need to estimate shielding (lower energy gammas are attenuated more than higher energy gammas by shielding, but by amounts that depend on the unknown types and amount of shielding) and to have a prior estimate of relative source activity. To define \(f_{AR}\), a lower bound \(B_{L}\) and upper bound \(B_{U}\) are defined such that if the relative peak area for a matched peak lies between \(B_{L}\) and \(B_{U}\). For larger discrepancy in the matched peak areas, an exponential decay in the penalty is used that allows for more widely separated matched peaks to differ more in area due to energy-dependent attenuation effects. Figure 4: Raw data, smooth fit 1 and smooth fit 2 for U-235 spectrum. Reference [8] used a custom library that was created using simulated spectra from each isotope in the library [31]. This labor-intensive approach used the estimated minimum resolvable energy to create composite peaks, eliminating unresolvable peaks. To illustrate, several library peaks of I-131 do not appear to the eye of the measured I-131 spectrum in Figure 1 and would be unlikely to appear in the custom library in [31]. Although [8] reported stable posterior probability results for the two isotopes evaluated (Eu152 and Co60), clearly \(P(D|M)=f_{LPI}f_{DPI}f_{FPR}f_{AR}\) is ad hoc, and is not to be interpreted as a true likelihood. Therefore, there has been no attempt to quantify uncertainty in the model choice stage so [8] did not address to what extent its Bayesian approach actually led to _well calibrated_ probabilities that a given isotope was present in each test item. That is, among all the test items for which the estimated posterior probability that isotope A was present was, for example, approximately 90%, was the actual fraction that included A close to 90%?