Antonino Ingargiola edited Fitting.tex  over 9 years ago

Commit id: 4f1ac44696dd82a6233d8ee6a950df08c1114d63

deletions | additions      

       

\subsection{Population fit}  The fitting module \verb|mfit| allows to fit burst populations with a model. Typically, a bursts selection is perfomed first and aftewards  the histograms of the $E$ or $S$ values of the selected bursts is are  fitted to a model. Under the hood the histogram fit is performed using the \href{http://lmfit.github.io/lmfit-py/}{lmfit} library. library, and, in fact,   a fit model is an \verb|lmfit.Model| object.  In general a model can be automatically built from any function. Before fitting fitting, however,  all the model parameters need to haveassigned  an initial value and (optional) (optionally)  some constrains. A series FRETBursts includes a set  of functions starting (starting  with \verb|factory| in \verb|mfit| \verb|mfit.factory_|) that  return pre-initialized models (for suitable for  E and S histogram fitting) for fitting. A set of  commonly used functions, for example 1 or 2 gassian peaks with or without "bridge" function. function, are provided. These "factory" functions take optional arguments to change the initital value for the model parameters. For more info refer to the  \href{http://fretbursts.readthedocs.org/en/latest/mfit.html#model-factory-functions}{factory-functions documentation}.  For example, to fit the E histogram of bursts in \verb|ds| with two Gaussian peaks we execute: 

For more example on fitting bursts data and plotting results see the \href{http://nbviewer.ipython.org/urls/raw.github.com/tritemio/FRETBursts_notebooks/master/notebooks/FRETBursts\%2520-\%2520us-ALEX\%2520smFRET\%2520burst\%2520analysis.ipynb}{us-ALEX notebook}.  For more info on defining custom model or on changing the constraints  \subsubsection{Correction coefficients}