I have a square matrix $Y$ and I would like to find the solution $X$ for the following equation: $$X(X^TX)^{-1}=X(Y^TY)^{-1}$$

In this equation, we can suppose that $Y^TY$ is invertible. We could also rewrite the equation as: $$X\left(I-(Y^TY)^{-1}X^TX\right)=0$$ if this could be useful, at least there is no requirement that $X^TX$ is invertible in this form.

Is this a common equation or one where the solution is straightforward to write?


As suggested in the comments, $X=Y$ will probably work!

  • 2
    $\begingroup$ How about using X=Y? $\endgroup$ Commented Sep 4, 2022 at 23:37
  • 1
    $\begingroup$ Probably worth a try! Indeed I am sometimes looking for a complex answer to a so simple question... $\endgroup$
    – PC1
    Commented Sep 5, 2022 at 0:03
  • 1
    $\begingroup$ There is more than one solution; for instance, $X = QY$ for every orthonormal $Q$. So it would be better to specify if you want a solution, or to describe all solutions. $\endgroup$ Commented Sep 5, 2022 at 11:43
  • $\begingroup$ I am looking for any solution as the important matrix is $X^TX$. So the ease of computation is more my concern here. Any solution is acceptable (so $X=Y$ is good). $\endgroup$
    – PC1
    Commented Sep 5, 2022 at 17:53

1 Answer 1


Notice that $X(X^T X)^{-1}$ is the Moore-Penrose inverse of $X^T$. Using properties of pseudo-inverse we get

$(Y^TY)(X^T X)^\dagger = I$

For instance $X=Y$ or $X=\text{Cholesky}(Y^T Y)$


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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