Parameters

class gammapy.utils.fitting.Parameters(parameters, covariance=None, apply_autoscale=True)[source]

Bases: object

List of Parameter.

Holds covariance matrix

Parameters:

parameters : list of Parameter

List of parameters

covariance : ndarray, optional

Parameters covariance matrix. Order of values as specified by parameters.

apply_autoscale : bool, optional

Flag for optimizers, if True parameters are autoscaled before the fit, see autoscale

Attributes Summary

names List of parameter names
parameters List of Parameter.

Methods Summary

autoscale([method]) Autoscale all parameters.
copy() A deep copy
covariance_to_table() Convert covariance matrix to Table.
error(parname) Get parameter error.
from_dict(val)
set_covariance_factors(matrix) Set covariance from factor covariance matrix.
set_error(parname, err) Set parameter error.
set_parameter_errors(errors) Set uncorrelated parameters errors.
set_parameter_factors(factors) Set factor of all parameters.
to_dict()
to_table() Convert parameter attributes to Table.

Attributes Documentation

names

List of parameter names

parameters

List of Parameter.

Methods Documentation

autoscale(method='scale10')[source]

Autoscale all parameters.

See autoscale()

Parameters:

method : {‘factor1’, ‘scale10’}

Method to apply

copy()[source]

A deep copy

covariance_to_table()[source]

Convert covariance matrix to Table.

error(parname)[source]

Get parameter error.

Parameters:

parname : str, int

Parameter name or index

classmethod from_dict(val)[source]
set_covariance_factors(matrix)[source]

Set covariance from factor covariance matrix.

Used in the optimiser interface.

set_error(parname, err)[source]

Set parameter error.

Parameters:

parname : str, int

Parameter name or index

err : float or Quantity

Parameter error

set_parameter_errors(errors)[source]

Set uncorrelated parameters errors.

Parameters:

errors : dict of Quantity

Dict of parameter errors.

set_parameter_factors(factors)[source]

Set factor of all parameters.

Used in the optimiser interface.

to_dict()[source]
to_table()[source]

Convert parameter attributes to Table.