Alternating Minimization for Regression Problems with Vector-valued Outputs