I'm familiar with the closed-form solution of ordinary least squares which minimizes $\sum_{n=1}^N(y_n - \mathbf{\beta x_n})^2$ for scalar $y_n$. However, in my situation I am trying to fit some data to a vector output through a matrix transformation, so I am instead looking to minimize the norm of the difference for each sample:


where $\mathbf{y_n}$ is now a vector and the parameters are now a matrix $B$. I suspect I am just unfamiliar with the name for this as searches of "vector response OLS" and "matrix OLS" keep bringing me the compact matrix formulation of OLS rather than the problem above.

  • 4
    $\begingroup$ The key search term is "multivariate." Many people confuse this with "multiple regression," so eliminate "multiple," include "squares" to capture the OLS flavor of your problem, and check out the hits: stats.stackexchange.com/…. In light of this, what is your question? $\endgroup$
    – whuber
    Feb 20, 2019 at 17:04
  • 1
    $\begingroup$ The model you're looking for is called "Multivariate Multiple Regression" $\endgroup$ Feb 20, 2019 at 17:07

1 Answer 1


Ah, I just realized that I can run OLS on each output variable separately with the same input data and concatenate the resulting parameter vectors into $B$. The cost function is separable into the OLS cost of each output variable:


where $\mathbf{B_k}\in \mathbb{R}^{1\times D}$ is the k-th row of $B$. OLS minimizes each term, and the total will be minimized because the parameters of each term are independent.

  • $\begingroup$ This is correct. However, in practice it often is too much to suppose that you really want to minimize the sum of squares: typically you need to weight the different variables differently, perhaps by unknown amounts; and not infrequently, you also have to account for nonzero correlations among them: that's what makes it truly a multivariate problem. $\endgroup$
    – whuber
    Feb 20, 2019 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.