Ardo Illaste edited fit_iter.md  almost 10 years ago

Commit id: 35660d9d69cca1870d36e88bda89b2c8804c4664

deletions | additions      

       

Fitting of potential event regions is performed iteratively. The algorithm is depicted on figure x.   First, the highest ranked regions are fitted with the extended fit function. After parameter optimization with the signal in the region is fitted with a linear model. For both models the corrected Akaike Information Criterion (AICc \cite{Burnham_2004}) is calculated and the region is taken to contain an event only if the AICc for the fit function is less than the AICc for the line. This ensures that the fit obtained with the fit function is good enough to justify the use of a the  more complicated model. After thiseach  the fits are fit is  subtracted from the original signal. This allows the lower ranked regions to be fitted with reduced interference from higher ranking regions (see supporting info figures). When all regions have been fitted and their fits subtracted from the signal, the remaining signal is fitted with a polynomial function to approximate the baseline fluorescence. In the second stage signals from approved regions are fitted again. Before performing the fit, fit for each region,  the baseline and previously obtained fits for other regions are subtracted from the raw signal. This allows the simpler fit function to be used as the subtraction eliminates the need for the extra baseline parameters (B and C). Once all regions are fitted in this manner the results are subtracted from the raw signal to estimate the baseline again. The second fitting stage is repeated once to improve the quality of the fits.