FitResults

class sherpa.fit.FitResults(fit, results, init_stat, param_warnings)[source] [edit on github]

Bases: NoNewAttributesAfterInit

The results of a fit.

This object contains the parameter values, information on the statistic and optimisation-method used, and other relevant information.

Changed in version 4.10.1: The covarerr attribute has been renamed to covar and now contains the covariance matrix estimated at the best-fit location, if provided by the optimiser.

datasets

A sequence of the data set ids included in the results.

Type

sequence of int or str, or None

itermethodname

What iterated-fit scheme was used, if any.

Type

str or None

methodname

The name of the optimisation method used (in lower case).

Type

str

statname

The name of the statistic function.

Type

str

succeeded

Was the fit successful (did it converge)?

Type

bool

parnames

the parameter names that were varied in the fit (the thawed parameters in the model expression).

Type

tuple of str

parvals

The parameter values, in the same order as parnames.

Type

tuple of number

statval

The statistic value after the fit.

Type

number

istatval

The statistic value at the start of the fit.

Type

number

dstatval

The change in the statistic value (istatval - statval).

Type

number

numpoints

The number of bins used in the fits.

Type

int

dof

The number of degrees of freedom in the fit (the number of bins minus the number of free parameters).

Type

int

qval

The Q-value (probability) that one would observe the reduced statistic value, or a larger value, if the assumed model is true and the current model parameters are the true parameter values. This will be None if the value can not be calculated with the current statistic (e.g. the Cash statistic).

Type

number or None

rstat

The reduced statistic value (the statval field divided by dof). This is not calculated for all statistics.

Type

number or None

message

A message about the results of the fit (e.g. if the fit was unable to converge). The format and contents depend on the optimisation method.

Type

str

nfev

The number of model evaluations made during the fit.

Type

int

extra_output

The extra_output field from the fit.

covar

The covariance matrix from the best-fit location, if provided by the optimiser.

Type

tuple or None

modelvals

The values of the best-fit model evaluated for the data.

Type

array

Methods Summary

format()

Return a string representation of the fit results.

Methods Documentation

format()[source] [edit on github]

Return a string representation of the fit results.

Returns

txt – A multi-line representation of the fit results.

Return type

str