There is currently no built-in procedure to impose inequality constraints on coefficients during estimation. A standard "hack" to impose simple inequality constraints is to apply a monotonic transformation to the coefficient so that the transformed expression takes on values only in the desired range. The commonly used transformations are the exponential (for one-sided restrictions) and the logit and arctan (for two-sided restrictions).
One-sided restrictions
Suppose in a regression of y on a constant and x you want to restrict the coefficient estimate on x to be no larger than 1. Then you can specify your equation as follows
- Code: Select all
' restrict coef on x not to exceed 1
equation eq1.ls y = c(1) + (1-exp(c(2)))*x
Note that you have to explicitly specify your equation with an equals sign since the transformation introduces a nonlinear specification. Although EViews will report an estimate for c(2), the estimated coefficient on x is given by the expression 1-exp(c(2)) (which you can store as a named scalar or in a named coef vector).
Two-sided restrictionsSuppose in a regression of y on a constant and x you want to restrict the coefficient estimate on x to be between -1 and 1. You can use the following logit transformation if you want to restrict your coefficient, say c(2), to lie between L and H
- Code: Select all
(H-L)*@logit(c(2)) + L
In our example, we have L = -1 and H = 1 so you would specify the equation as
- Code: Select all
equation eq2.ls y = c(1) + (2*@logit(c(2))-1)*x
Again EViews will only report an estimate for c(2) and you will have to manually compute the expression 2*@logit(c(2))-1 to obtain the point estimate of the coefficient on x.
Mixed equality and inequalityA commonly encountered mixed type of restriction is to have all parameters non-negative and sum up to one
- Code: Select all
ai > 0 and a1 + a2 + ... + ak = 1
A reparameterization that satisfies these constraints is
- Code: Select all
ai = exp( bi ) / ( exp( b1 ) + exp( b2 ) + ... + exp( bk ) )
where the bi parameters are unconstrained.