Multivariate Linear Regression With Coefficient Constraint

Click For Summary

Discussion Overview

The discussion centers around implementing a multivariate linear regression (MVLR) with a constraint that the coefficients remain positive. Participants explore various methods for achieving this constraint within the context of least squares optimization.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant describes the setup of a multivariate linear regression problem and seeks a method to ensure that the coefficients (\beta) are positive.
  • Another participant suggests using a restricted minimization problem (Lagrangian) for the sum of squared errors (SSE) and mentions the REG procedure in SAS as a possible approach.
  • A request for more detailed explanation of the constrained optimization procedure is made, particularly in relation to Lagrange multipliers and the use of MATLAB.
  • One participant points out that Mathematica's NMinimize and NMaximize functions can be used for nonlinear constrained global optimization and suggests looking for similar algorithms in MATLAB.
  • Another participant proposes an iterative approach to constrain the coefficients one at a time, discussing how to minimize the error while checking the conditions of the coefficients.
  • A later reply indicates that the MATLAB function lsqnonneg meets the participant's needs for ensuring positive coefficients, speculating that it aligns with the suggestions made by others in the thread.

Areas of Agreement / Disagreement

Participants express various methods for achieving the constraint on coefficients, but no consensus is reached on a single approach. Multiple competing views and techniques remain under discussion.

Contextual Notes

Some participants express uncertainty regarding the implementation details of constrained optimization in different software environments, such as MATLAB and SAS. The discussion includes various assumptions about the applicability of different methods without resolving these uncertainties.

dansu
Messages
3
Reaction score
0
[SOLVED] Multivariate Linear Regression With Coefficient Constraint

I'm attempting a multivariate linear regression (mvlr) by method of least squares. Basically, I'm solving a matrix of the following form for \beta_p,<br /> $ \begin{bmatrix} \sum y \\ \sum x_1 y \\ \sum x_2 y \\ \sum x_3 y \end{bmatrix} = \begin{bmatrix} n &amp; \sum x_1 &amp; \sum x_2 &amp; \sum x_3 \\ \sum x_1 &amp; \sum x_1^2 &amp; \sum x_1 x_2 &amp; \sum x_1 x_3 \\ \sum x_2 &amp; \sum x_2 x_1 &amp; \sum x_2^2 &amp; \sum x_2 x_3 \\ \sum x_3 &amp; \sum x_3 x_1 &amp; \sum x_3 x_2 &amp; \sum x_3^2 &amp; \end{bmatrix}\begin{bmatrix} \beta_0 \\ \beta_1 \\ \beta_2 \\ \beta_3 \end{bmatrix} $\end{text}

x are sets of data, y is the data I want to fit, and \beta are the coefficients.

My problem is that I want to set a constraint such that \beta remains positive. What would be a good way to achieve this?
 
Physics news on Phys.org
In general, you need to set up a restricted minimization problem (Lagrangian) for the sum of squared errors (SSE); then minimize SSE subject to the constraint.

E.g. the REG procedure in SAS uses RESTRICT statement, which reverts to a constrained optimization algorithm.

Specifically, if you run the unrestricted MVLR and it outputs a positive coefficient then you don't need the constraint. If the unrestricted coefficient is < 0, then you need to use constrained minimization.
 
Last edited:
If you don't mind, could you or somebody else explain that procedure in more detail? I have only minimal experience working with lagrange multipliers. I'm unfamiliar with SAS. I've been running my numbers through Matlab.
 
In Mathematica NMinimize & NMaximize functions are used to solve nonlinear constrained global optimization problems. Perhaps you can search for similar algorithms in Matlab?
 
This might work; but I'd constrain the beta's (to zero) one at a time, and do it alternatively.

E.g. if beta1 < 0 and beta3 < 0 in the full model then first minimize (y - b0 - b1 x1 - b2 x2 - b4 x4)^2, and see whether beta1 is still < 0. Alternatively, minimize (y - b0 - b2 x2 - b3 x3 - b4 x4)^2 and see whether beta3 is still < 0. If the answer to both questions is "yes," then minimize (y - b0 - b2 x2 - b4 x4)^2. In all other cases (yes&no, no&yes, no&no), you'll have a model selection problem and you will have to use a model selection criterion (e.g. the F statistic or the adjusted R-squared).
 
Last edited:
thank you all for your help.

I have found that the MATLAB function lsqnonneg does exactly what I am looking for. I'm speculating that it follows a procedure similar to what vedenev and EnumaElish are suggesting.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 13 ·
Replies
13
Views
4K
Replies
3
Views
3K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
4K
  • · Replies 12 ·
Replies
12
Views
4K