Objective functions and constraints
smoother.DerivativeObjective
class smoother.DerivativeObjective(d=1, weight=None) [source]
A Smoother
objective function which minimizes the sum of a square
derivative.
Parameters and attributes: | d : int, default=1
e.g. |
---|
Methods
__call__(self, smoother) [source]
Parameters: | smoother : Smoother
The smoother to which this objective function applies. |
---|---|
Returns: | value : float
Approximate mean square derivative over all points of the distribution. |
smoother.MassConstraint
class smoother.MassConstraint(lb, ub, mass, weight=None) [source]
A Smoother
constraint that forces a certain amount of probability mass
to be within a given range.
Parameters and attributes: | lb : float
Lower bound of the range within which the probability mass must be. ub : floatUpper bound of the range within which the probability mass must be. mass : float between 0. and 1.
Amount of probability mass between
Weight to place on the constraint. If |
---|
Methods
__call__(self, smoother) [source]
Parameters: | smoother : Smoother
Smoother to which this constraint applies. |
---|---|
Returns: | loss : float
|
smoother.MomentConstraint
class smoother.MomentConstraint(value, degree, type_='raw', norm=False, weight=None) [source]
A Smoother
constraint that forces a moment condition to hold.
Parameters and attributes: | value : float
The target value of the moment. degree : intThe degree of the moment; e.g. the 1st moment is the mean. type_ : str, default='raw'
Type of moment: Indicates whether to apply a norm to the moment. weight : float or None, default=None
Weight to place on the constraint. If |
---|
Methods
__call__(self, smoother) [source]
Parameters: | smoother : Smoother
Smoother to which this constraint applies. |
---|---|
Returns: | loss : float
|