Antonino Ingargiola edited Fitting.tex  over 9 years ago

Commit id: 5e33d472d64a7f9a1c53b636afc431ddde86d8a7

deletions | additions      

       

The fitting module \verb|mfit| allows to fit burst populations with a model. Typically, a bursts selection is perfomed first and the histograms of the $E$ or $S$ values of the selected bursts is fitted to a model. Under the hood the  histogram fit is performed using the \href{http://lmfit.github.io/lmfit-py/}{lmfit} library.  In general a model can be automatically built from any function. Before fitting all the model parameters need to have assigned an initial value and (optional) some constrains. A series of functions starting with \verb|factory_| \verb|factory|  in \verb|mfit| return pre-initialized models (for E and S histogram fitting) for commonly used functions, for example 1 or 2 gassian peaks with or without "bridge" function. For example, to fit the E histogram of bursts in \verb|ds| we execute: 

Here, \verb|ds| is the variable with the burst data (selected bursts), \verb|'E'| is the name of the Data field to fit, \verb|binwidth| is the bin width of the histogram and \verb|model| is a pre-initialized model used for fitting.  \begin{itemize}  \item Histogram fit: chose a model, constraints, methods, accuracy  \item KDE: find the maximum  \end{itemize}