I have a simple system which practically follows $Ax=B$, where $x$ is input, $B$ is output and $A$ are parameters.
I have set of $k$ experiments data, so $x$ is actually $N$ by $k$, and $B$ is $M$ by $k$.
I know also that each value in $A$ matrix is positive. My problem is to find $A$ that would give the best fit to experimental data, and fulfill requirement of $A$ being positive.
Is there a proper and established way of solving this problem?
You have $x$ being a matrix so I rename it $X$.
The optimization problem you try to solve is:
\begin{align} \min_{A} \lvert| AX-B |\rvert_F^2 \;\;\;\;\;s.t. \,\,A\geq0 \end{align}
We can get the solution by projected gradient descent, i.e. projecting each update on $A$ into the nonnegative orthant via operator $\mathcal{P}_+$, i.e.
\begin{align} \mathcal{P}_+(A) = \max(A,0) \end{align}
Where the $\max$ is applied elementwise.
The gradient of the objective function is:
\begin{align} \frac{\partial \Phi}{\partial A}=2(AX-B)X^T \end{align}
The update on $A$ is then
\begin{align} A_{k+1}=\mathcal{P}_+\left(A_k-\alpha(A_kX-B)X^T\right) \end{align}
With $\alpha$ being the step size.