0

I have the following equation that I want to solve:

H*b0 = M(Q+1)b(Q+1)+l+M'B

The unknowns are b0, b(q+1) and B. The sizes of the known matrices are:

H=(42 x 42)

M(Q+1) = (42 x 21-P)

l = (42 x 1)

M' = (42 x 4)

So I want to figure out how to find the vectors.

Is there a built in command that I could do to do this?

This comes from This paper

EDIT:: Size of unknowns should be (all are column vectors):

b0 = 21
b(q+1) = 21-P (P=4 in this case)
B = P (4 in this case)
yankeefan11
  • 485
  • 1
  • 6
  • 18
  • I think there is some misunderstanding, could you also list the size of your unknown variables? – Dennis Jaheruddin Aug 06 '13 at 13:41
  • I edited the question to show the sizes – yankeefan11 Aug 06 '13 at 13:43
  • Dimensions don't seem to match. `M(Q+1)` is 42 by 42 and `b(Q+1)` is 17 by 1? Also, you don't have enough constraints as the two answers already say. Which part of the paper does this come from? I can't read the whole paper just to answer this question. – Memming Aug 06 '13 at 14:10
  • As to which part of the paper, it is in 4A. That is all I am stuck at. I just changed M(q+1) to be 42 x 17 , as it should be – yankeefan11 Aug 06 '13 at 14:14
  • I was going to answer this question. Obscenely bad formatting of the equations. So I decided to write down more clearly for myself what you had. I immediately got stuck because of mismatching dimensions. H is claimed to be 42x42, and B0 a vector of length 21. H*b0 does not conform for multiplication. And M(Q+1) is terrble notation, as it either tends to imply that M is a function of Q, or that there is a multiplication, or whatever. Hard to read. And why in the name of god would you name a variable l? You do realize how much it looks like the number 1? –  Aug 06 '13 at 14:36
  • More bad: Is M different from M(Q+1)? Why use a variable named M', since ' is the transpose operator in MATLAB, and this question is about MATLAB? It will take me 20 minutes just to figure out what your question really asks! –  Aug 06 '13 at 14:38

3 Answers3

2

First, rearrange your equation:

H b0 - M(Q+1) B(Q+1) - M' B = l

Now, you can concatenate variables. You will end up with an unknown vector (X) of size 42 + 21 + 4 = 67. And a coefficient matrix (A) of size 42 x 67

X = [b0;  B(Q+1);  B ];   % <- don't need to execute this; just shows alignment
A = [ H, -M(Q+1), -M'];

Now you have an equation of the form:

A X = l

Now you can solve this in a least-squares sense with the \ operator:

X = A \ l

This X can be turned back into b0, B(Q+1), and B using the identity above in reverse:

b0 = X(1:42);
B(Q+1) = X(43:63);
B = X(64:67);
JoshG79
  • 1,685
  • 11
  • 14
0

As is, the problem certainly has too many degrees of freedom. Of course you have some constraints, but without knowing what kind of constrains you have I cannot really know which solution to suggest.

Suppose you only have upper and lower bounds on b(Q+1) and knew b0 is 1 everywhere, the problem would reduce to a constrained linear least squares problem.

There is a function in Matlab that can do that for you: http://www.mathworks.nl/help/optim/ug/lsqlin.html

There are mulltiple possible ways to call this function, I think the simplest one that can still do the trick for you is this:

x = lsqlin(C,d,A,b,Aeq,beq,lb,ub)

I am not an expert in this field, but if you can think of a trick to write your problem in this form, it would certainly be the easiest solution.


For practical purposes: if you cannot find a way to solve this complicated problem, perhaps try fixing b0 to some reasonable values in order to get a decent solution.

Dennis Jaheruddin
  • 21,208
  • 8
  • 66
  • 122
  • Well the way I want it is that I should have 42 equations with 42 unknowns. It is explained in the paper, but I do not see how to solve it. – yankeefan11 Aug 06 '13 at 13:24
-1

Your problem can have a lot of solutions ; indeed you have :

42 coefficients for b0 21 coefficients for B(q+1) 21 coefficients for B

You only have 42 equations for a total of 84 coefficients !

Your problem has to be refined, with additional constraints. Once you have enough constraints, you should be able to use linear least squares in order to find out your coefficients.

for 42 constraints and variables, you don't need a function, matrix manipulations are enough. You want to find the vector X such as H*X = Y

An estimation of X is (H'*H)^-1*H'*Y.

So in Matlab :

X ~ (H'*H)\H'*Y

Don't forget to check that H'H is well conditioned and positive definite.

So all you have to do is concatenate your 3 vector coefficients in X, put your constraint coefficients in H and Y, use the formula.

Cheers

David
  • 1,138
  • 5
  • 15
  • I actually have a few restraints. How do I use the least squares with these restraints? – yankeefan11 Jul 30 '13 at 17:26
  • NO. NO. NO. You have not even written the normal equations form properly, and it is a bad way to solve a linear least squares problem. Worse, it will fail for under-determined systems! Use X=H\Y instead. –  Jul 30 '13 at 17:53
  • How do I reduce 3 unknown vectors to 1 single unknown? – yankeefan11 Jul 30 '13 at 18:37
  • Where has it been stated that H'*H is well conditioned? In fact, it appears that the person asking this question has no idea what the conditioning is. –  Jul 30 '13 at 18:42
  • 1
    Yeah I have no idea wha that means – yankeefan11 Jul 31 '13 at 13:18