If normal linear regression finds $A$ such that $$AX \sim Y$$ then how should I solve $$BAX \sim Y$$ where $B$, $X$ and $Y$ are given (non-invertible) matrices? I could of course derive the solution by hand, but I need a numerically stable solution, and would rather make a call to a pre-written library function.
2026-03-30 15:34:49.1774884889
If normal linear regression finds $A$ such that $AX \sim Y$, then how do I solve $BAX \sim Y$?
26 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
I recommend using a $QR$-decomposition of $B$ which is quite stable.
$B = Q_B R_B$ which results in:
$$AX \approxeq R_B^{-1} Q_B^t Y =: Z$$
Then you can use your prefered method for finding $A$. (I'd do it with a QR-decomposition of $X$ too.)
So just for convenience I rewrite this as
$$ X^t A^t = Z^t$$
Then we calculate the QR-decomposition of $X^t$, that is $Q_x R_x = X^t$ and we get
$$ A^t = R_x^{-1} Q_x^t Z^t = R_x^{-1} Q_x^t Y^t Q_B R_B^{-t}$$
or if you prefer
$$ A = R_B^{-1} Q_B^t Y Q_x R_x^{-t}$$