0

I've been struggling with the parameterization of quadprog function in Matlab for a problem like this:

enter image description here

where x is a matrix of x 0 w 0 +x 1 w 1 +x 2 2 w 2 and y is the target vector containing a value for each row of x, w is the weight vector, lambda is a scalar value.

I have tried this, but I'm sure it's not correct:

N = size(x, 2);
Sigma = cov(x);
H = 2.0*Sigma;
c = zeros(N,1);
quadprog(H, c)

Could someone please guide me with what the parameters should be for the quadprog function?

AD.Net
  • 13,352
  • 2
  • 28
  • 47

1 Answers1

2

This optimization problem is known as Lasso, and as you wrote it it is not formally a quadratic program. You can either convert it to a quadratic program, see this link, or you can use Matlab's builtin lasso (part of Statistics toolbox)

Community
  • 1
  • 1
Itamar Katz
  • 9,544
  • 5
  • 42
  • 74