# Multivariate linear regression/aproximation

I'm solving a problem which features a function $f: \mathbb{R}^4 \rightarrow \mathbb{R}^4.$ I don't know the function, but I assume it's linear and it can be expressed as $\mathbf{y} = \mathbf{A} \cdot \mathbf{x},\; \mathbf{A} \in \mathbb{R}^{4\times 4},\; \mathbf{x},\mathbf{y} \in \mathbb{R}^{4}$.

I have a lot of data, ie. $(\mathbf{x}, \mathbf{y})$ tupples and my first thought was to perform some kind of least-squares fitting in order to obtain the matrix $\mathbf{A}$. However, I'm not sure if this approach is correct, because I've only seen the least-squares applied to functions $\mathbb{R}^{n} \rightarrow \mathbb{R}$. If I used least-squares I'd perform the fitting for each of the $f$'s range variables separately, which I doubt is valid.

How to solve this problem correctly?

-
Since $y_1$ doesn't depend on the other $y_i$ in you linear model, you should be able to estimate each row of $A$ separately. Since you are minimising the sum of squares in least squares, you are minimising the sum of squares by adding each of the four sum of squares for each element. – Daryl Feb 2 '13 at 11:11
You're right. Thank you for your comment. – Jan Hadáček Feb 2 '13 at 11:29