I am trying to solve the following equation $min_{P} F(P)=||P^TX−P^TYZ−LP^TX+A||^2_F$ with $P$ is a $(d,p)$ matrix ,$X$ a $(d,n)$ matrix ,$Y$ a $(d,m)$ matrix ,$L$ a $(p,p)$matrix , $Z$ a $(m,n)$ matrix and $A$ a $(p,n)$ matix.
When computing the derivative I end up with : $\frac{∂F}{∂P}=2(XM−YZM−XML)$ with $M=(P^TX−P^TYZ−LP^TX+A)^T$.
But I stuck here ,I dont know How to extrate the optimal value of $P$
Please can someone help me to solve this problem.
Your gradient calculation looks correct, so let's continue from there.
For convenience define the matrix $$W=X-YZ$$so that $$M=W^TP-X^TPL^T+A^T$$Setting the gradient to zero and rearranging terms yields $$\eqalign{ WM &= XML \cr WW^TP-WX^TPL^T+WA^T &= XW^TPL-XX^TPL^TL+XA^TL \cr WW^TP-WX^TPL^T-XW^TPL+XX^TPL^TL &= XA^TL-WA^T \cr }$$ Vectorize this equation in order to isolate and solve for $P$ $$\eqalign{ {\rm vec}(XA^TL-WA^T) &= (I\otimes WW^T-L\otimes WX^T-L^T\otimes XW^T+L^TL\otimes XX^T)\,{\rm vec}(P) \cr {\rm vec}(B) &= C\,{\rm vec}(P) \cr {\rm vec}(P) &= C^{+}{\rm vec}(B) \cr }$$ I have no idea if the coefficient matrix $C$ is invertible, so I used the Moore-Penrose inverse.