Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a system of equations I'm trying to solve:

$$\begin{align}Q &= MP \\ Q^\prime &= M\Pi P\end{align}$$

$Q$, $Q^\prime$, and $P$ are all $4\times n$ matrices, and $M$ and $\Pi$ are both $4\times4$ matrices. Unfortunately, $M$ is not invertible because it has a zero determinant, and neither are $Q$, $Q^\prime$, or $P$ because they are not square. $\Pi$ should be invertible.

Given that I know $Q$, $Q^\prime$, and $M$, how can I find $\Pi$ and $P$?

Note the problem is over determined, so I'm looking for a least squares type solution.

share|cite|improve this question
up vote 2 down vote accepted

Let $M^+$ denote the Moore-Penrose psuedoinverse of $M$

Solving $MP=Q$ gives:


Then to find $\Pi$ we can left multiply by $M^+$ and right multiply by $Q^+M=P^+$

$\Pi=M^+Q'Q^+M+(I-M^+M)X + Y(I-M^+QQ^+M)$

For arbitrary $4\times4$ matrices $X,Y$

The extra terms add a matrix whose columns are in the nullspace of $M$ and one who's rows are in the left nullspace of $P$. It represents our freedom in choosing $\Pi$

Note: This will be the least squares solution relative to the vectorized version of the system.

share|cite|improve this answer
Thanks! Two questions: how do I solve for pi? it's also unknown. How do I calculate the Moore-Penrose psuedo-inverse? – Jason Jan 20 '13 at 16:34
I think I can figure out my second question (…), but how do I solve for PI? – Jason Jan 20 '13 at 16:36
Sorry, I misread your question. I thought $\Pi$ was also known. – Tim Seguine Jan 20 '13 at 16:36
@Jason I edited the question. Are you familiar with the Singular Value Decomposition? That is usually the first step. The requirement that $\Pi$ is invertible is not exactly satisfied by this solution, but we can always find a matrix that is arbitrarily close to it which is invertible. – Tim Seguine Jan 20 '13 at 16:53
@Jason I need to make another change. – Tim Seguine Jan 20 '13 at 17:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.