1

Hello community I am new here and I have a question which might be pretty basic.

So I am trying to solve an equation. I have 3 matrices

A = \begin{pmatrix}1&0&0&0&0&0&0&0\\0&1&1&0&0&0&0&0\end{pmatrix}

B = \begin{pmatrix}0&0&0&0&0&0&1&0\\0&0&0&0&0&0&0&1\end{pmatrix}

and K = \begin{pmatrix}1&0&0&0&0&0&0&0\\0&1&1&0&0&0&0&0\\0&0&0&0&0&0&1&0\end{pmatrix}

H = \begin{pmatrix}A\\B\end{pmatrix}

and Z = \begin{pmatrix}z1\\z2\\z3\end{pmatrix}

And I have linear system

$\begin{pmatrix}H\\K\end{pmatrix} v = \begin{pmatrix}0\\Z\end{pmatrix}$

It says that solution for determined system is

$ v = \begin{bmatrix}\begin{pmatrix}H\\K\end{pmatrix}^T \begin{pmatrix}H\\K\end{pmatrix} \end{bmatrix} ^{-1}\begin{pmatrix}H\\K\end{pmatrix}^T \begin{pmatrix}0\\Z\end{pmatrix} $

Okay when I put this system of matrices in python it shows that matrix inside [] can't be inverse. I am presumping that

H = \begin{pmatrix}A\\B\end{pmatrix} just means that

H is

\begin{pmatrix}1&0&0&0&0&0&0&0\\0&1&1&0&0&0&0&0\\0&0&0&0&0&0&1&0\\0&0&0&0&0&0&0&1\end{pmatrix}

Two matrices put together. Same I presume for \begin{pmatrix}H\\K\end{pmatrix}

Where am I wrong?

Ps: sorry im new here hope I wrote everything correctly and understandable. Happy holidays everyone.

Jean Marie
  • 81,803

1 Answers1

0

For the sake of simpler notations, let us rename $$L:=\begin{pmatrix}H\\K\end{pmatrix} \ \ \text{and} \ \ P:=\begin{pmatrix}0\\Z\end{pmatrix} $$

giving :

$$Lv=P \tag{1}$$

which is a $7 \times 8$ system (thus an underdetermined system : less constraints than the number of unknowns).

Instead of your $$ v = (L^T L)^{-1}L^T P $$

which is a formula valid for overdetermined systems, one must take for an underdetermined system :

$$ v = L^T(L L^T)^{-1} P \tag{2}$$

(see https://see.stanford.edu/materials/lsoeldsee263/08-min-norm.pdf for the difference of formulas between under- and over-determined systems ; in this document, a matrix like $L$ with more columns than lines is called "fat").

This will give you a so-called "mean-squares" solution.

Proof of (1) : Plug (2) into (1), you will get :

$$\underbrace{L L^T(L L^T)^{-1}}_{\text{identity matrix} \ I} P=P...$$

Jean Marie
  • 81,803
  • Thank you so much for the time and effort. I tried your way and indeed i got a solution, but i think its the wrong one. since i still get that v4 = 0 whiere it should be v4 = v5 = 1/3(vz1+vz3 -vz2). This is just an example of the error, there are more of them. And I have another question. How do I know if its pseudo-inverse, where it doesn't say in the exercise? – Noob Programmer Dec 13 '18 at 10:22
  • Did you notice that I have completely re-written my answer. I had made a mistake (I had sticked to your formula which is not the right one). In particular, I do not use any more the pseudo inverse. Besides, I am going to add a proof for the formula I gave. – Jean Marie Dec 13 '18 at 10:33
  • Sorry didn't notice, didn't refresh my page. Thank you for your effort. It solved my problem :) – Noob Programmer Dec 13 '18 at 10:47
  • I have added a reference. – Jean Marie Dec 13 '18 at 13:23