Multivariate regression is equivalent to performing an inversion of the covariance of a set of input variables. Since there are many solutions to invert the matrix (if the dimension is not very high. Thousand should be fine), you should go directly for the best fit instead of gradient descent.
n is the number of samples, m is the number of input variables, and k is the number of output variables.
X be the input data (n,m) Y be the target data (n,k) A be the coefficients you want to estimate (m,k) XA = Y X'XA=X'Y A = inverse(X'X)X'Y
X' is the transposition of X.
As you can see, once you find the inverse of X'X , you can calculate the coefficients for any number of output variables with just a few matrix multiplications.
Use any simple math tools to solve this problem (MATLAB / R / Python ..).
source share