Bases: astropy.modeling.core.Model
Base class for all fittable models.
Parameters: | param_dim : int
fixed : dict
tied : dict
bounds : dict eqcons : list
ineqcons : list
|
---|
Notes
All models which can be fit to data should subclass this class.
Sets the parameters attributes.
Examples
>>> from astropy.modeling import models
>>> def tie_center(model):
... mean = 50 * model.stddev
... return mean
>>> tied_parameters = {'mean': tie_center}
Specify that 'mean' is a tied parameter in one of two ways:
>>> g1 = models.Gaussian1D(amplitude=10, mean=5, stddev=.3,
... tied=tied_parameters)
or
>>> g1 = models.Gaussian1D(amplitude=10, mean=5, stddev=.3)
>>> g1.mean.tied
False
>>> g1.mean.tied = tie_center
>>> g1.mean.tied
<function tie_center at 0x...>
Fixed parameters:
>>> g1 = models.Gaussian1D(amplitude=10, mean=5, stddev=.3,
... fixed={'stddev': True})
>>> g1.stddev.fixed
True
or
>>> g1 = models.Gaussian1D(amplitude=10, mean=5, stddev=.3)
>>> g1.stddev.fixed
False
>>> g1.stddev.fixed = True
>>> g1.stddev.fixed
True
Attributes Summary
bounds | |
col_deriv | bool(x) -> bool |
deriv | |
eqcons | List of parameter equality constraints. |
fittable | bool(x) -> bool |
fixed | A dictionary mapping parameter names to their fixed constraint |
ineqcons | List of parameter inequality constraints. |
linear | bool(x) -> bool |
parameters | A flattened array of all parameter values in all parameter sets Fittable parameters maintain this list and fitters modify it. |
tied | A dictionary mapping parameter names to their tied constraint |
Methods Summary
set_joint_parameters(jparams) | Used by the JointFitter class to store parameters which are considered common for several models and are to be fitted together. |
Attributes Documentation
A flattened array of all parameter values in all parameter sets
Fittable parameters maintain this list and fitters modify it.
Methods Documentation
Used by the JointFitter class to store parameters which are considered common for several models and are to be fitted together.