I came across this mle formula in some (undocumented) code performing linear regression with input matrices $A$ and $B,$ and was wondering how it was derived. It might also be some level of approximation, I'm not entirely sure.
$y$ is a $N$-dimensional vector, $A$ is $N \times M$ matrix, $B$ is $N \times P$ matrix
$$y \sim \operatorname{Normal}(A\alpha + B\beta, \sigma^2I)$$
the MLE $\hat{\alpha}$ is supposedly $\hat{\alpha} = \frac{y \cdot A \: - \: (Q^TA \:\cdot\: Q^Ty)}{A A \: - \: (Q^TA \:\cdot \:Q^TA)}$
where $Q$ in the above formula is $Q$ from QR-decomposition on $B$ (the $Q$ in this case is from thin/skinny QR-decomp, but I doubt it affects the derivation). I don't understand where $\hat{\alpha}$ formula comes from, any help would be appreciated!