LFD Book Forum (http://book.caltech.edu/bookforum/index.php)
-   Chapter 3 - The Linear Model (http://book.caltech.edu/bookforum/forumdisplay.php?f=110)
-   -   Linear regression question (http://book.caltech.edu/bookforum/showthread.php?t=4247)

 Xing Wu 04-25-2013 03:28 PM

Linear regression question

Hello, I have a question about linear regression,
Ax=b, how to find constrained solution, like some elements of x have to be positive.
Thank you.

 htlin 04-25-2013 11:24 PM

Re: Linear regression question

Quote:
 Originally Posted by Xing Wu (Post 10601) Hello, I have a question about linear regression, Ax=b, how to find constrained solution, like some elements of x have to be positive. Thank you.
One possibility is to minimize |Ax - b| subject to the constraints of non-negative x, which is a linear programming problem. If you want to minimize the squared error subject to non-negative x, it would be a quadratic programming problem. Hope this helps.

 Xing Wu 04-26-2013 09:47 AM

Re: Linear regression question

Yeah, thanks.
But even the constraints are very sparse, I still need linear programming or quadratic programming? Do you have some related papers to recommend? Thank you.

 Elroch 04-27-2013 12:31 AM

Re: Linear regression question

If I understand correctly, you have some data you are trying to do linear regression on, but you also have some knowledge of the form of the solution?

Well, first you could find the solution if the constraints were not there. If this happens to satisfy the constraints, you are done.

If it doesn't, the solution must lie on the boundary defined by the constraints, given some assumptions. If the constraints are simple enough, you may be able to rewrite your problem with the knowledge that it is on the boundary. For example if you wanted a 1-dimensional linear regression solution and knew the intercept with the y-axis had to be positive, but linear regression gave a unique solution with the intercept as negative (due presumably to noise in the data, I believe the constrained solution would have to have an intercept at zero.

 All times are GMT -7. The time now is 08:12 AM.