FitResult#

class gammapy.modeling.FitResult(optimize_result=None, covariance_result=None)[source]#

Bases: object

Fit result class.

The fit result class provides the results from the optimisation and covariance of the fit.

Parameters:
optimize_resultOptimizeResult

Result of the optimization step.

covariance_resultCovarianceResult

Result of the covariance step.

Attributes Summary

backend

Optimizer backend used for the fit.

covariance_result

Optimize result.

message

Optimizer status message.

method

Optimizer method used for the fit.

minuit

Minuit object.

models

Best fit parameters of the optimization step.

nfev

Number of function evaluations of the optimisation step.

optimize_result

Optimize result.

parameters

Best fit parameters of the optimization step.

success

Total success flag.

total_stat

Total stat of the optimization step.

trace

Parameter trace of the optimisation step.

Methods Summary

to_dict([full_output, overwrite_templates])

Convert to dictionary.

to_yaml([full_output, overwrite_templates])

Convert to YAML string.

write(path[, overwrite, full_output, ...])

Write to file.

Attributes Documentation

backend#

Optimizer backend used for the fit.

covariance_result#

Optimize result.

message#

Optimizer status message.

method#

Optimizer method used for the fit.

minuit#

Minuit object.

models#

Best fit parameters of the optimization step.

nfev#

Number of function evaluations of the optimisation step.

optimize_result#

Optimize result.

parameters#

Best fit parameters of the optimization step.

success#

Total success flag.

total_stat#

Total stat of the optimization step.

trace#

Parameter trace of the optimisation step.

Methods Documentation

to_dict(full_output=False, overwrite_templates=False)[source]#

Convert to dictionary.

to_yaml(full_output=False, overwrite_templates=False)[source]#

Convert to YAML string.

write(path, overwrite=False, full_output=False, overwrite_templates=False, checksum=False)[source]#

Write to file.

Parameters:
pathpathlib.Path or str

Path to write files.

overwritebool, optional

Overwrite existing file. Default is False.

full_outputbool, optional

Store full parameter output. Default is False.

overwrite_templatesbool, optional

Overwrite templates FITS files. Default is False.

checksumbool, optional

When True adds a CHECKSUM entry to the file. Default is False.