TITLE: Solve least-squares minimization from overdetermined system with orthonormal constraint
QUESTION [13 upvotes]: I would like to find the rectangular matrix $X \in \mathbb{R}^{n \times k}$ that solves the following minimization problem:
$$
\mathop{\text{minimize }}_{X \in \mathbb{R}^{n \times k}} \left\| A X - B \right\|_F^2 \quad \text{ subject to  } X^T X = I_k
$$
where $A \in \mathbb{R}^{m \times n}$ and $B \in \mathbb{R}^{m \times k}$ are given. This appears to be a form of the orthogonal Procrustes problem, but I'm getting tripped up in my case when $X$ is not square and $n \gg k$ and $m > n$.
Optimistically, I'm looking for a solution that would involve singular value decomposition of a small $k \times k$ matrix, but I'm not seeing it. I'm especially interested in the case when $$A = \left(\begin{array}{c} D_1 \\ D_2\end{array}\right) \in \mathbb{R}^{2n \times n}$$ and $D_1,D_2$ are rank-sufficient diagonal matrices. This is to say that a solution involving $D_1^{-1}$ and $D_2^{-1}$ would be acceptable. The closest I've come (using "Thin SVD" on $Y$) is:
$$
Y = (A^TA)^{-1}(A^T B) \\
Y = U \Sigma V^T \\
X = UV^T
$$
clearly $X^T X = I_k$, but 

I haven't convinced myself that this is the minimizer,
this involves inverting a potentially huge $n \times n$ matrix (perhaps unavoidable and not so bad in the stacked diagonal case above where $(A^TA)^{-1} = (D_1^2 + D_2^2)^{-1}$, and 
this involves s.v.d. of a large rectangular $n \times k$ matrix.

Is this correct and as good as it gets? Or, is there a more efficient solution?

REPLY [2 votes]: Just to add another remark: finding a solution to your problem is equivalent to finding matrices $U_{n\times k}$ and $V_{k\times k}$, and a diagonal matrix $D$, such that $U^TU = I$, $V^TV = I$, and
\begin{equation}
A^TB = UDV^T + A^TAUV^T, \tag{1}
\end{equation}
in which case $X = UV^T.$
Interestingly, this is also true when $n=k$. In this case, if
$$A^TB = \mathcal{U}\Sigma\mathcal{V}^T$$
is the singular value decomposition of $A^TB$, then $D$ is given by the spectral decomposition
$$\Sigma - \mathcal{U}^TA^TA\mathcal{U} = RDR^T,$$ 
and $U = \mathcal{U}R, V = \mathcal{V}R.$ 
This solution does not work when $n>k$, but the equation (1) above looks an awful lot like some kind of generalized singular value decomposition, so perhaps there is hope...
As a practical stop-gap I'd be tempted to try fixed-point iteration
$$A^TB - A^TAU_i V_i^T = U_{i+1}D_{i+1}V_{i+1}^T.$$