Newer
Older
Master_thesis / thesis / fitresult.tex
\subsection{Results and uncertainties}

After every minimisation, the information about the process as well as the 
results are returned as a \pyth{FitResult}. This object does not only store 
information but is also capable of performing uncertainty estimations of the 
parameters. 

The most important information that it collects is:

\begin{itemize}
	\item Information about the parameters, including the values at 
	the function minimum, information about their limits and uncertainties 
	calculated using different methods.
	\item General information about the minimisation 
	itself, including
	\begin{itemize}
		\item A flag that indicates whether the minimisation was 
		successful or not.
		\item The minimum of the loss function that was determined by the 
		minimiser.
		\item An estimation made by the 
		minimiser of how far away the minimum value is from the actual true 
		minimum.
		\item All the additional information produced by a minimiser. This can 
		highly vary depending on which minimiser was used.
	\end{itemize}
	
	\item The instance of the minimiser that was used to perform 
	minimisation. Since 
	minimisers are stateless, no information is stored in it.\footnote{Ideally. 
	Some minimisers like iminuit have a state and can be accessed like this. A 
	copy of the actual minimiser is stored in the \pyth{FitResult}}
	\item The instance of the loss that was minimised. Since a 
	loss keeps references to the model and data it was built with, it is 
	possible to thereby
	retrieve all information regarding this minimisation.
\end{itemize}

As the last of five steps in the minimisation workflow, the \pyth{FitResult} 
serves again as an 
additional abstraction layer. A lot of different statistical quantities such as 
limits, confidence intervals and more can be calculated using the result, loss 
and minimiser. Since they are all bundled together in the \pyth{FitResult}, 
no other object is required for advanced statistical treatment of fit results.

\subsubsection{Parameter uncertainties}

The values of the parameters at the minimum are important, but they are 
meaningless without an uncertainty estimate. Therefore, the \pyth{FitResult} 
provides two ways of calculating it:

\begin{itemize}
	\item For a fast, approximative and symmetric estimate, the \pyth{hesse} 
	method can be invoked. It provides an estimation based on the Hessian 
	matrix, assuming a second order approximation of the loss around the 
	minimum value of the parameter. 
	\item If there are high non-linearities in the loss and the 
	parameter correlations, the actual uncertainties differ strongly from what 
	\pyth{hesse} returns. Good estimates can 
	be retrieved by creating a profile: fixing the parameter at a certain value 
	and run a complete minimisation. The calculation is invoked by using the 
	\pyth{error} method. If the Minuit minimiser was used to perform the 
	minimisation, the \pyth{minos} method can be invoked in this way. 
	Currently, no other error estimation is implemented, but any custom 
	statistical method can be easily applied thanks to the information 
	contained in the fit result.
	
\end{itemize}

To only calculate the uncertainties with respect to specific parameters, the 
desired parameters can be given as arguments to \pyth{hesse} and \pyth{error}. 
The results for each parameter are cached and won't be recomputed on an 
additional call.