Recovery of compound-Poisson-lognormal parameters ================================================= Data generated by an ICP-TOF is non-integer due to a lack of a pulse counting mode, see :ref:`spICP-ToF: Compound-Poisson` for more information. This complicates determination of a :term:`detection threshold` as we cannot use the normal Poisson or Gaussian statistics. Closely approximating the signal produced by a TOF using a compound-Poisson-lognormal distribution allows the use of our and :ref:`lookup table` method. However, both of these approaches require some knowledge of the underlying distribution, including the shape parameter (:math:`\sigma`) of the lognormal part. Typically these parameters are measured by collecting a large amount of data using an ionic solution with a low enough concentration to produce primarily single-ion events, essentially collecting the non-Poisson part of the compound-Poisson. This is referred to as the single-ion area (SIA) and the mean or mode of a fit to this data is used to convert raw detector signal into approximate counts. By fitting a lognormal, we can also measure the parameters required for thresholding, :math:`\mu` and :math:`\sigma`. However, frequent measurement of the SIA is required as it changes over time. The shape and location of the SIA is also known to vary with an ions mass [1]_. SPCal uses the following method to recover parameters required for thresholding from collected data. Method for recovery ------------------- Drawing a value from a compound-Poisson-lognormal distribution is performed by taking :math:`N` samples from a lognormal and summing them, where the value of :math:`N` is drawn from a Poisson. .. math:: Y &= \sum_{i=0}^{N} lognormal(\mu, \sigma) \\ N &\sim Poisson(\lambda) As the lognormal cannot produce zeros, we know that all zeros in the data must come from the Poisson portion of the compound distribution. We can use this knowledge to calculate :math:`\lambda` from the fraction of zeros, using the Poisson mass probability function. .. math:: \lambda = -\log{P(Y=0)} We can then use the laws of total expectation and variance to calculate expected values of the lognormal portion using the mean and variance of the data. .. math:: E[X] &= \frac{E[Y]}{\lambda} \\ E[X^2] &= \frac{V[Y]}{\lambda} Finally we can recover the lognormal parameters :math:`\mu` and :math:`\sigma` using their method of moments. .. math:: \mu &= \log{\frac{E[X]^2}{\sqrt{E[X^2]}}} \\ \sigma &= \sqrt{\log{\frac{E[X^2]}{E[X]^2}}} As particle signals will alter the true mean and variance of data they must be filtered out prior to the recovery of parameters. This is performed by repeatedly recovering parameters then thresholding the data using an :math:`\alpha` of :math:`10^{-4}` until the threshold or parameters no longer change. The value of :math:`\sigma` is bound to 0.2 - 1.0, to reduce the numbers of iterations required. The signal either side of detected regions is also removed to reduce the change of low, but particle related signal, being included. Automatic calculation of SIA shape in SPCal ------------------------------------------- .. warning:: Extraction of compound-Poisson-lognormal parameters requires a sufficient number of non-zero values. For data with a very low mean the extracted shape may be inaccurate. The above method can be used to extract the shape parameter from data loaded into SPCal, eliminating the need to measure it separately and providing a per-mass shape. This method requires concurrent measurement of a 1 - 10 ppb ionic standard, as is typically used for calibration. .. [1] Gundlach-Graham, A.; Lancaster, R. Mass-Dependent Critical Value Expressions for Particle Finding in Single-Particle ICP-TOFMS. Anal. Chem. 2023, 95 (13), 5618–5626. ``_.