on our proof for the SMV case, we conjecture that the proposed algorithm is optimal for arbitrary additive error metrics in the MMV case.

Achievable part: Metric-optimal estimation algorithm {#sec:achievable}
----------------------------------------------------

The metric-optimal algorithm consists of two parts, as illustrated in Algorithm \[algo:metric\_opt\_MMV\]. We first run an MP algorithm (Algorithm \[algo:AMP\_MMV\] provides an implementation of an MP algorithm) to get the noisy pseudo data $\q^{(j)}, \forall j$, and the noise variance $\Delta_v$ (details below). Next, we denoise $\q^{(j)}, \forall j$, using an optimal denoiser tailored to minimize the given error metric. The following discusses both parts in detail.

\
[**Inputs:**]{} Measurements $\y^{(j)}$ and matrices $\A^{(j)}, \forall j$\
[**Part 1 (Algorithm \[algo:AMP\_MMV\]):**]{} Obtain pseudo data $\q^{(j)},\ \forall j$, and scalar channel noise variance $\Delta_v$ from MP($\y^{(j)}, \A^{(j)}, \forall j$)\
[**Part 2 (examples in Section \[sec:example\]):**]{} Obtain optimal estimate $\widetilde{\x}^{(j)}$ from denoiser using $\q^{(j)},\Delta_v, \forall j$\
[**Outputs:**]{} $\widetilde{\x}^{(j)},\ \forall n$

\
[**Inputs:**]{} Maximum number of iterations $t_{\text{max}}$, threshold $\epsilon$, sparsity rate $\rho$, noise variance $\Delta_z$, measurements $\y^{(j)}$, and measurement matrices $\A^{(j)}, \forall j$\
[**Initialize:**]{} $t=1,\delta=\infty,\k^{(j)}=\y^{(j)},\Theta_m^{(j)}=0,s^{(j)}_n=\rho\Delta_z,\widehat{x}_n^{(j)}=0, h_m^{(j)}=0, \forall m,n,j$ \[line:beginForLoop\]\
$\boldsymbol{\Theta}^{(j)}=(\A^{(j)})^2 \s^{(j)}$\[line:Theta\]\
$\k^{(j)}=\A^{(j)} \widehat{\x}^{(j)}-\text{diag}(\boldsymbol{\Theta}^{(j)}) \h^{(j)}$\
$h_m^{(j)}=g_{\text{out}}\l(k_m^{(j)},y_m^{(j)},\Theta_m^{(j)}\r)$\[line:g\_out\]\
$r_m^{(j)} = -\frac{\partial}{\partial k_m^{(j)}} g_{\text{out}}\l(k_m^{(j)},y_m^{(j)},\Theta_m^{(j)}\r)$\[line:deriv\_g\_out\]\
// Scalar channel noise variance\
$\Delta_v^{(j)}=\l\{\frac{1}{N} \mathbf{1}^T \l[(\A^{(j)})^T\r]^2 \mathbf{r}^{(j)}\r\}^{-1}$ \[line:scalarNoiseVar\]\
$\q^{(j)}=\widehat{\x}^{(j)}+\Delta_v^{(j)} (\A^{(j)})^T 