Finally I figured out with help of this page :)
I explain the approach in some steps:
Create U[k*m] and V[k*n] and fill them arbitrarily
Compute derivatives for objective function on Ui and Vj
Do gradient descent as follows:
while (your criteria satisfies(optimizing error function F)) { Ui=Ui+a(U'i); Vj=Vj+a(V'j); Evaluate F using new values of Ui and Vj; }
With the minimum F , take U and V, compute transpose(U)*V and the result is estimated R (a is step size or learning rate)