CDF fit#
One method of determining the reaction parameters is fitting the cumulative density function (CDF), which can be obtained by integrating the PDF from \(0\) to \(t\):
Since at \(t=\infty\) the CDF should be equal to 1, we have \(\sum_{i=1}^{n} P_i = 1\) and thereby
Fitting the CDF has the advantage of not requiring any binning, however, for transition rates of the same order of magnitude as the frame rate it will be important to use a truncated probability distribution as explained for maximum likelihood estimation. For the cdf we can leave the lower truncation value as a free fit parameter, thus not requiring an estimation by the user (contrary to maximum likelihood estimation). As shown by the plots below, this results in a truncation value close to half the frame interval.
[2]:
fig, axes = plt.subplots(1,2, figsize=(9,3), layout='constrained')
_ = file.analyze_dwells(method='cdf_fit', number_of_exponentials=[1,2], state_names={0: 'Low FRET', 1:'High FRET'},
plot=True, plot_dwell_analysis_kwargs=dict(plot_type='cdf', plot_range=(0,2), axes=axes))
Plotting the PDF using the CDF fit parameters shows that this also corresponds well to the dwell time histogram.
[3]:
fig, axes = plt.subplots(1,2, figsize=(9,3), layout='constrained')
_ = file.plot_dwell_analysis(plot_type='pdf', plot_range=(0,2), axes=axes, log=False)