I've the following question. Consider the equality $$A = C B D$$ with $B\in\mathbb{R}^{n\times n}$, $C\in\mathbb{R}^{k\times n}$ and $D\in\mathbb{R}^{n\times k}$. Particularly, $n>k$ and $C$ and $D$ have full rank. I would like to find an explicit expression of $B$ as a function of $A,C,D$.
How should I pick a generalized inverse properly?
Thanks in advance!
Whenever the equation is solvable, i.e. whenever $A=CB_0D$ for some $B_0$, you always have $B=C^+AD^+$ as a solution, because $$ CBD=CC^+AD^+D=CC^+CB_0DD^+D=CB_0D=A. $$ In fact, by vectorising both sides of the equation $A=CBD$, we see that $$ \operatorname{vec}(B)=(D^T\otimes C)^+\operatorname{vec}(A)=\left((D^+)^T\otimes C^+\right)\operatorname{vec}(A)=\operatorname{vec}(C^+AD^+) $$ is the least-norm solution to the least-square problem $\min_{B\in M_n(\mathbb R)}\|A-CDB\|_F^2$.