Given the functions $f_1(r,x)$ and $f_2(r,y)$: $[0,1]\times \Bbb R \to \Bbb R ^+$, solve the following problem
$$\underset{r,x,y}{\text{argmin}}\; f_1(r,x)+f_2(r,y) \\ \text{subject to}\; x^2+y^2=1$$
When is this equivalent to
$$\underset{r}{\text{argmin}}\; (\underset{x}{\text{argmin}}f_1(r,x)+\underset{y}{\text{argmin}}f_2(r,y)) \\ \text{subject to}\; x^2+y^2=1\;\;?$$
Generally speaking when do we have
$$\underset{x,y}{\text{argmin}}\; f(x,y)=\underset{x}{\text{argmin}}\; \underset{y}{\text{argmin}}\;f(x,y)\;\;?$$
Would the result be any different if the $f_1$ and $f_2$ were convex?
EDIT:
I believe I need to give mote context to the problem that I am trying to solve.
Simplifying a little bit, I have a statistical model where I am trying to model two groups (parameters $x$ and $y$). The parameter $r$ is for both groups.
I want to minimize the negative log-likelihood with the given constraint. That would correspond to the first problem.
Now in reality, I have more then 50 groups (and the corresponding 50 parameters) and still one "global" parameter $r$.
So the idea (maybe wrong?) is to minimize for a given $r$ without the constraint and then to minimize over $r$ so that the constraint is satisfied. I.e. the second problem should be defined as
$$h(r): r \mapsto (x^*,y^*)=(\underset{x}{\text{argmin}}\; f_1(r,x), \underset{y}{\text{argmin}}\;f_2(r,y)) \\
\underset{r}{\text{argmin}}\; (||h(r)||_2^2-1)^2$$
Under which conditions this second problem is equivalent to the first one?