4.1.2.2.1. statsmodels.base._constraints.TransformRestriction¶
-
class
statsmodels.base._constraints.
TransformRestriction
(R, q=None)[source]¶ Transformation for linear constraints R params = q
Note, the transformation from the reduced to the full parameters is an affine and not a linear transformation if q is not zero.
Parameters: R : array_like
Linear restriction matrix
q : arraylike or None
values of the linear restrictions
Notes
The reduced parameters are not sorted with respect to constraints.
TODO: error checking, eg. inconsistent constraints, how?
Inconsistent constraints will raise an exception in the calculation of the constant or offset. However, homogeneous constraints, where q=0, will can have a solution where the relevant parameters are constraint to be zero, as in the following example:
b1 + b2 = 0 and b1 + 2*b2 = 0, implies that b2 = 0.
The transformation applied from full to reduced parameter space does not raise and exception if the constraint doesn’t hold. TODO: maybe change this, what’s the behavior in this case?
The reduce transform is applied to the array of explanatory variables, exog, when transforming a linear model to impose the constraints.