Okay so here is what I am trying to do,
I have a matrix $X$ consisting of values $X_{nm}$.
I have to find vectors $P_n$ and $Q_m$ of length $k$, such that the value $$Y_{nm} = P_n \text{ . } Q_m^T$$ and the error $(X_{nm}-Y_{nm})^2$ is minimized
Could anyone tell me how I can achieve that?