Direct FRET fitting¶
See also Fit framework
This module contains functions for direct fitting of burst populations (FRET peaks) without passing through a FRET histogram.
This module provides a standard interface for different fitting algorithms.
- fretbursts.fret_fit.fit_E_E_size(nd, na, weights=None, gamma=1.0, gamma_correct=False)¶
Fit the E with least-square minimization of errors on burst E values.
- fretbursts.fret_fit.fit_E_binom(nd, na, noprint=False, method='c', **kwargs)¶
Fit the E with MLE using binomial distribution. method (‘a’,’b’, or ‘c’) choose how to handle negative (nd,na) values.
- fretbursts.fret_fit.fit_E_cdf(nd, na, gamma=1.0, **kwargs)¶
Fit E using the CDF curve-fit (see gaussian_fit_cdf). No weights are possible with this method.
- fretbursts.fret_fit.fit_E_hist(nd, na, gamma=1.0, **kwargs)¶
Fit E using the histogram curve-fit (see gaussian_fit_hist). You can specify
weights
that will be passed to thehistogram
function.
- fretbursts.fret_fit.fit_E_m(nd, na, weights=None, gamma=1.0, gamma_correct=False)¶
Fit the E with a weighted mean of burst E values.
- fretbursts.fret_fit.fit_E_poisson_na(nd, na, bg_a, **kwargs)¶
Fit the E using MLE with na extracted from a Poisson.
- fretbursts.fret_fit.fit_E_poisson_nd(nd, na, bg_d, **kwargs)¶
Fit the E using MLE with nd extracted from a Poisson.
- fretbursts.fret_fit.fit_E_poisson_nt(nd, na, bg_a, **kwargs)¶
Fit the E using MLE with na extracted from a Poisson.
- fretbursts.fret_fit.fit_E_slope(nd, na, weights=None, gamma=1.0)¶
Fit E with a least-squares fitting of slope on (nd,na) plane.
- fretbursts.fret_fit.get_dist_euclid(nd, na, E_fit=None, slope=None)¶
Returns the euclidean distance of (nd,na) from a fit line. The fit line is specified by
slope
or byE_fit
. Intercept is always 0.
- fretbursts.fret_fit.get_weights(nd, na, weights, naa=0, gamma=1.0, widths=None)¶
Return burst weights computed according to different criteria.
The burst size is computed as
nd*gamma + na + naa
.- Parameters
nd, na, naa (1D arrays) – photon counts in each burst.
gamma (float) – gamma factor used for corrected burst size.
width (None array) – array of burst durations used when weights=’brightness’
weights (string or None) – type of weights, possible weights are: ‘size’ burst size, ‘size_min’ burst size - min(burst size), ‘size2’ (burst size)^2, ‘sqrt’ sqrt(burst size), ‘inv_size’ 1/(burst size), ‘inv_sqrt’ 1/sqrt(burst size), ‘cum_size’ CDF_of_burst_sizes(burst size), ‘cum_size2’ CDF_of_burst_sizes(burst size)^2, ‘brightness’ the burst size divided by the burst width. If None returns uniform weights.
widths (1D array) – bursts duration in seconds, needed only when weights = ‘brightness’.
- Returns
1D array of weights, one element per burst.
- fretbursts.fret_fit.log_likelihood_binom(E, nd, na)¶
Likelihood function for (nd,na) to be from a binom with p=E (no BG).
- fretbursts.fret_fit.log_likelihood_poisson_na(E, nd, na, bg_a)¶
Likelihood function for na extracted from Poisson. nd, na BG corrected.
- fretbursts.fret_fit.log_likelihood_poisson_nd(E, nd, na, bg_d)¶
Likelihood function for nd extracted from Poisson. nd, na BG corrected.
- fretbursts.fret_fit.log_likelihood_poisson_nt(E, nd, na, bg_a)¶
Likelihood function for na extracted from Poisson. nd, na BG corrected.
- fretbursts.fret_fit.sim_nd_na(E, N=1000, size_mean=100)¶
Simulate an exponential-size burst distribution with binomial (nd,na)