# Application of the Approximate Bayesian Computation Algorithm to Gamma-Ray Spectroscopy
## 5 Net Peak Area Extraction and ABC
### Abc  
Any Bayesian approach requires a prior probability and a likelihood to compute the posterior probability of model as \((M|D)\propto P(D|M)p(M)\), where \(P(D|M)\) is the likelihood and \(p(M)\) is the prior probability of model \(M\). The likelihood \(P(D|M)\) is key to any statistical approach, Bayesian or non-Bayesian (\"frequentist\") [33; 34]. ABC provides a way to modify the approach in [8] using summary statistics computed from spectra. The factors \(f_{LPI},f_{DPI}f_{PR},f_{AR}\) become candidate statistics for use by ABC. Other candidate statistics include one or multiple peak fits to key regions, off-peak count rates at selected energy bins, scan statistic values associated with chosen peaks, and the net signal attributable to each isotope in the library. The net signal \(\frac{\mu_{1}}{\sigma_{1}}\), \(\frac{\mu_{1}+\mu_{2}}{\sqrt{\sigma_{1}^{2}+\sigma_{2}^{2}}}\), \(\ldots\), \(\frac{\sum_{i=1}^{p}\mu_{i}}{\sqrt{\sum_{i=1}^{p}\sigma_{i}^{2}}}\) for 1, 2, \(\ldots\), \(p\) peaks is the net signal-to-noise ratio assigned to the recognized peaks, where \(\mu_{i}\) is the peak height (\"signal\") for peak i and \(\sigma_{i}\) is the peak width for peak \(i\). Recall that DRFs typically assume a Gaussian-shaped peak with a tail and background as \(f(E)\) in Equation (1). Because the number of candidate statistics is large, one could perform ABC separately for each library isotope, following the approach in [9; 10]. In any Bayesian approach, prior information regarding the magnitudes and/or relative magnitudes of any model parameter(s) can be provided. If the prior is \"conjugate\" for the likelihood (for example, a gamma prior is conjugate for the Poisson likelihood), then the posterior is in the same likelihood family as the prior, in which case analytical methods are available to compute posterior prediction intervals for quantities of interest. So that a wide variety of priors and likelihoods can be accommodated, modern Bayesian methods do not rely on conjugate priors, but use numerical methods to obtain samples from approximate posterior distributions [34]. For numerical methods such as Markov Chain Monte Carlo [34], the user specifies a prior distribution (which need not be normal), for the parameters to be inferred, such as which subset of the library isotopes is present and in what amounts in the test item and possibly which shielding materials are present [3; 5; 30]. The user must also specify a likelihood for the data given the model parameters. In contrast, ABC does not require likelihood for the data; and, as in any Bayesian approach, ABC accommodates constraints on variances through prior distributions [22; 25; 26; 33]. ABC Inference  
For \(i\) in 1, 2,..., \(N\) (typically, \(N\) is large, such as \(10^{4}\) or \(10^{5}\) or more) do these three steps:  
1. Sample \(\theta\) from the prior, \(\theta\sim f_{prior}(\theta)\);
2. Simulate data \(x^{\prime}\) from the conditional pdf \(P(x|\theta)\);
3. Denote the real data as \(x\). If the distance \(d(S(x^{\prime}),S(x))\leq\varepsilon\), then accept \(\theta\) as an observation from \(f_{posterior}(\theta|x)\);  
Experience with ABC suggests that the ABC approximation to \(f_{posterior}(\theta|x)\) improves if step (3) is modified to include a weighting factor, so that trial values of \(\theta\) simulated from \(f_{prior}(\theta)\) that lead to very small distance \(d(S(x^{\prime}),S(x))\) are more heavily weighted in the estimated posterior [22; 35]. In step (2), the model can be analytical or, for example, a forward transport model. In ABC, the model has input parameters \(\theta\), has output data \(x^{\prime}\sim P(x|\theta)\), and there is corresponding real data \(x_{obs}\). For example, \(f(x)\) in Equation (1) is a forward model (with energy \(E\) denoted generically as \(x\) here) with 12 parameters (three for the peak: peak width, location, height; five for the tail associated with the dominant peak; and four for the background as modeled by \(P_{1}\)-\(P_{4}\)).