0

I have a signal X1 = [a1,...aN] where the values [a1,....,aN] are always >0

I have other 599 signals X2, X3, ...,X600 of the same length (N) of X1. These signals could assume values >0 and <0.

I know that the sum of all the 600 signals is always positive and equal to the signal S
S = X1 + X2 + ... + X600

I would like to distribute the first signal X1 in order to reduce the negative values of the other signals in the best possible way...could you suggest me how to do that (I use matlab)?

In the best case S = X2' + X3' + ... + X600' where X2', X3' etc are positive signals.

Thanks

EDIT

% signal x1
x=rand(1,1000);
x(x<0)=0.01;

% signals x2,....,x599 contained in the rows of A
A=rand(599,1000);
gabboshow
  • 5,359
  • 12
  • 48
  • 98

1 Answers1

0

It seems like you want to minimize the following objective (J) over (A):

J = sum( abs( x(:,1) - A*x(:,1)) ) +...
             sum(negativehockeystick( x(:, 2:end) + A.*x(:,1))

where A is an 599*N matrix (the variable of the optimization).

and 'negativehockeystick' is the function -min(x,0)

I think cvx can handle this problem as it looks convex (in A), but I am not sure

alexandre iolov
  • 582
  • 3
  • 11
  • Hi! I think that there is a bracket missing...maybe at the end? then where can I find the function negativehockeystick? – gabboshow Mar 30 '15 at 08:10
  • negativehockeystick = @(x) -min(x, 0) – alexandre iolov Mar 30 '15 at 09:33
  • Hi Alexandre. Thanks for the clarification. Does your code work with the example I gave in my question? I edited my question after your first answer... – gabboshow Mar 30 '15 at 12:19
  • % signal x1 x=rand(1000,1); x(x<0)=0.01; % signals x2,....,x599 contained in the rows of A A = rand(1000,599); negativehockeystick = @(x) -min(x,0) B = ones(1000,599); J = sum( abs( x - x.*sum(B,2)) +... sum(negativehockeystick( A + A.*B), 2)) – alexandre iolov Mar 30 '15 at 12:42
  • Now B is the objective variable, b/c you called A the X values, I will edit the original answer if this works – alexandre iolov Mar 30 '15 at 12:43
  • Thanks for your kind answer... now the code runs (i.e. I get J =3.0485e+05) but how should I interpret this result? – gabboshow Mar 30 '15 at 13:18
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/74105/discussion-between-alexandre-iolov-and-gabboshow). – alexandre iolov Mar 30 '15 at 13:44