Generic functions to fit exponential populations.
These functions can be used directly, or, in a typical FRETBursts workflow they are passed to higher level methods.
See also:
fretbursts.fit.exp_fitting.
expon_fit
(s, s_min=0, offset=0.5, calc_residuals=True)¶Fit sample s
to an exponential distribution using the ML estimator.
This function computes the rate (Lambda) using the maximum likelihood (ML) estimator of the mean waiting-time (Tau), that for an exponentially distributed sample is the sample-mean.
Parameters: |
|
---|---|
Returns: | A 4-tuple of the fitted rate (1/life-time), residuals array, residuals x-axis array, sample size after threshold. |
fretbursts.fit.exp_fitting.
expon_fit_cdf
(s, s_min=0, offset=0.5, calc_residuals=True)¶Fit of an exponential model to the empirical CDF of s
.
This function computes the rate (Lambda) fitting a line (linear regression) to the log of the empirical CDF.
Parameters: |
|
---|---|
Returns: | A 4-tuple of the fitted rate (1/life-time), residuals array, residuals x-axis array, sample size after threshold. |
fretbursts.fit.exp_fitting.
expon_fit_hist
(s, bins, s_min=0, weights=None, offset=0.5, calc_residuals=True)¶Fit of an exponential model to the histogram of s
using least squares.
Parameters: |
|
---|---|
Returns: | A 4-tuple of the fitted rate (1/life-time), residuals array, residuals x-axis array, sample size after threshold. |
fretbursts.fit.exp_fitting.
get_ecdf
(s, offset=0.5)¶Return arrays (x, y) for the empirical CDF curve of sample s
.
See the code for more info (is a one-liner!).
Parameters: |
|
---|---|
Returns: | (x, y) (tuple of arrays) – the x and y values of the empirical CDF |
fretbursts.fit.exp_fitting.
get_residuals
(s, tau_fit, offset=0.5)¶Returns residuals of sample s
CDF vs an exponential CDF.
Parameters: |
|
---|---|
Returns: | residuals (array) – residuals of empirical CDF compared with analytical
CDF with time constant |