I have the following function for two matrices ${\bf A}$ and ${\bf B}$:

$f({\bf A}, {\bf B}) = \| {\bf Y - XAB} \|_F^2 = trace\{({\bf Y - XAB)}^T({\bf Y - XAB)}\}$

where matrices ${\bf X}_{n \times p}$ and ${\bf Y}_{n \times q}$ are fixed, and matrices ${\bf A}_{p \times r}$ and ${\bf B}_{r \times q}$ are the variables, with $r<\min(p,q)$. I'd like to know whether this function is convex in *both* ${\bf A}$ and ${\bf B}$. (I am quite sure if either ${\bf A}$ or ${\bf B}$ is fixed, then, $f$ is convex for the other one.)

If it is not convex, can I impose some extra constraints on any of these matrices to make $f$ convex?