Antonino Ingargiola edited Fitting.tex  about 8 years ago

Commit id: 674b3f2f77129ede0d517bb651227a4fb282b196

deletions | additions      

       

(\href{http://fretbursts.readthedocs.org/en/latest/plugins.html#fretbursts.burstlib\_ext.bursts\_fitter}{link}).  \paragraph{Python details}  Under the hood, histogram fit fits  in FRETBursts is are  performed using the \href{http://lmfit.github.io/lmfit-py/}{lmfit} library~\cite{lmfit}.  Every fit model is, in fact, an Models returned by FRETBursts's factory functions (\verb|mfit.factory_*|)   are  \verb|lmfit.Model| object, and these object objects (\href{https://lmfit.github.io/lmfit-py/model.html}{link}).  Custom models  can be createdand modified by  calling directly \verb|lmfit| functions.  Fitting \verb|lmfit.Model| directly.  When  an lmfit \verb|Model| \verb|lmfit.Model| is fitted, it  returns an a \verb|ModelResults|  object with (\href{https://lmfit.github.io/lmfit-py/model.html#the-modelresult-class}{link})  which contains  all the results.  FRETBursts appends information related to  the fit result (model, data,   parameters with best values and uncertainties) and useful methods to operate on fit results.   FRETBursts puts \verb|ModelResults|  of each channel in the list \verb|ds.E_fitter.fit_res|.  As an example, to get the reduced $\chi^2$ value of the E histogram fit in a   single-spot measurement \verb|d|, we use:  \begin{lstlisting}  d.E_fitter.fit_res[0].redchi  \end{lstlisting}  Other useful attributes are \verb|aic| and \verb|bic| which contain the   Akaike information criterion (AIC) and the Bayes Information criterion (BIC)  quantities respectively. AIC and BIC allow to compare different models and  to select the most approriate for the data at hand.  Example of defining and modifying models for fitting are provided in   the μs-ALEX FRETBursts tutorial (\href{http://nbviewer.jupyter.org/github/tritemio/FRETBursts_notebooks/blob/master/notebooks/FRETBursts%20-%20us-ALEX%20smFRET%20burst%20analysis.ipynb}{link}).   Interested users should also refer to the excellent lmfit comprehensive lmfit's  documentation (\href{http://lmfit.github.io/lmfit-py/}{link}).