I'm trying to figure out what constraints I need to use to have monotonicity (both on $x$ and $z$) on the regression model with interaction. My model is:

$$\mathbb{E}[Y|x,z]= \beta_0+\beta_1x+\beta_2z+\beta_3xz,$$

thus, to get an increasing function in x and z, I need the derivatives wrt x and z to be positive: $$\beta_1+\beta_3z\ge0 \quad\text{ and } \quad\beta_2+\beta_3x\ge0$$

If x and z are both positive, I conclude: $\beta_i \ge 0, \quad i= 1,\ldots,3$.

Since I would estimate the model with standardised $x$ and $z$, I also can have negative values. How can I solve the system in that case?

Thanks for your help.

  • 3
    $\begingroup$ Why do you need these constraints? Imposing such constraints based on pre-conceptions about response-surface shapes can be unwise. $\endgroup$ – EdM Jan 27 '18 at 19:20
  • 2
    $\begingroup$ How do you derive this conclusion? If $x$ and $z$ can be arbitrarily large, then you cannot have $\beta_3$ be negative. Note, too, that this surface (qua function of $(x,z)$) is not a plane: it's a piece of a hyperboloid. $\endgroup$ – whuber Jan 27 '18 at 19:22
  • $\begingroup$ I need them because is a dose-response relation and I need to constraint the surface to be monotonic increasing. $\endgroup$ – Prunus avium Jan 27 '18 at 19:22
  • 1
    $\begingroup$ You're right @whuber, thanks. I can't consider the derivative without x and z just because they are positive. I'm going to correct my post! $\endgroup$ – Prunus avium Jan 27 '18 at 19:30
  • 2
    $\begingroup$ Also, dose-response curves often display hormesis in practice, non-monotonic shapes. Don't restrict your analysis unnecessarily; that might not be consistent with the underlying reality. $\endgroup$ – EdM Jan 28 '18 at 2:33

These types of constraints are linear in the variables, and a linear regression with linear constraints become a linearly constrained quadratic programming (QP) problem. Most regression solvers do not allow such constraints, but you can formulate it yourself and use an open source QP solver such as cvxopt (python).

For the relationship between QP and linearly constrained linear regression problems, see here.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.