I have an array ($Y$) with a series of data to which I must fit the sum of some other arrays $(X_1,X_2,X_3)$. The expression is:

$Y = c_1*X_1 + c_2*X_2 + c_3*X_3 + e$

I need to add some constraints (min and max values of $c_1$).

  • $\begingroup$ Why do you need (do you?) those constraints? $\endgroup$
    – Tim
    Jun 1, 2017 at 11:26
  • 1
    $\begingroup$ This is an extremely bad idea, you will not estimate any quantity of interest. Your inference will be wrong, your estimates will be biased, and the predictions will be off the charts $\endgroup$
    – Repmat
    Jun 1, 2017 at 16:46

1 Answer 1


If you just want to fit a least squares hyperplane with a constraint in one parameter, what I would do is:

  • Fit regression plane as usual.
  • If $c_1$ meets the constraints, you are done.
  • If $c_1$ is outside the constraints, take $c_1$ as the maximum or minimum constraint - whichever is closer to the fitted value. From this moment, $c_1$ is a constant and not a parameter to be estimated.
  • Now do the following regression analysis:

$$Y - c_1*X_1 = c_2*X_2 + c_3*X_3 + e$$

That is, now your response is $Y - c_1*X_1$ (an array of known values) and your predictors are $X_2$ and $X_3$.

Please notice that, although this least squares fitting may work, constraints may have effects on procedure and interpretation of significance tests or variable selection.


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.