satlas.stats.fitting.calculate_analytical_uncertainty

satlas.stats.fitting.calculate_analytical_uncertainty(f, x, y, method='chisquare_spectroscopic', filter=None, fit_args=(), fit_kws={})[source]

Calculates the analytical errors on the parameters, by changing the value for a parameter and finding the point where the chisquare for the refitted parameters is one greater. For MLE, an increase of 0.5 is sought. The corresponding series of parameters of the model is adjusted with the values found here.

Parameters:
  • f (BaseModel) – Instance of a model which is to be fitted.
  • x (array_like) – Experimental data for the x-axis.
  • y (array_like) – Experimental data for the y-axis.
Other Parameters:
 
  • method ({‘chisquare_spectroscopic’, ‘chisquare’, ‘mle’}) – Select for which method the analytical uncertainty has to be calculated. Defaults to ‘chisquare_spectroscopic’.
  • filter (list of strings, optional) – Select only a subset of the variable parameters to calculate the uncertainty for. Defaults to None (all parameters).
  • fit_kws (dictionary, optional) – Dictionary of keywords to be passed on to the selected fitting routine.

Note

The function edits the parameters of the given instance. Furthermore, it only searches for the uncertainty in the neighbourhood of the starting point, which is taken to be the values of the parameters as given in the instance. This does not do a full exploration, so the results might be from a local minimum!