Solution (source code)

= Solution

Assume first that $D=b^TV^{-1}b>0$. Since $X_M=\theta_M^TZ$,
$$
\mathbb EX_M=D,\qquad \operatorname{Var}(X_M)=D,
$$
and for $Y=\phi^TZ$,
$$
\mathbb EY=\phi^Tb,\qquad
\operatorname{Cov}(X_M,Y)=\theta_M^TV\phi=b^T\phi.
$$
The least-squares affine-regression coefficients are therefore
$$
\beta=\frac{b^T\phi}{D},\qquad
\alpha=\mathbb EY-\beta\mathbb EX_M=0.
$$
The minimum is
$$
\operatorname{Var}(Y)-\frac{\operatorname{Cov}(X_M,Y)^2}{\operatorname{Var}(X_M)}
=\phi^TQ\phi,
$$
where
$$
\boxed{Q=V-\frac{bb^T}{b^TV^{-1}b}}.
$$
This <matrix> is symmetric and positive semidefinite. If $b=0$, then $X_M=0$, one may take $\alpha=0$ and arbitrary $\beta$, and the minimum is $\phi^TV\phi$, corresponding to $Q=V$.