# Parameter identification for regression model

Consider the following regression model :

Y = AX + BU

where the size of Y is $N \times n$, A is $N \times n$, X is $n \times n$, B is $N \times n$ and U is $n \times 1$.

The matrices X,Y and U are kown and the matrices A and U have to be estimated.

Is there an optimal method (in the sense of minimal residual error between Y and its estimate) for estimating A and U simultaneously ?

The problem is, in general, underdetermined since you only have $Nn$ equations, but $Nn+n$ variables to determine. But that's not a problem for the least squares method -- it will simply find one solution.
(Of course, it is conceivable that $Y$ does not lie in the range of $A$-applied-to-X or $B$, in which case the residual of the minimizer will be minimal, but not zero.)