# Can I solve a non-negative non-linear least squares problem by solving for the square root of my desired solution and squaring it?

I'm hoping to use the Gauss-Newton method to solve a non-linear least squares problem where the solution $$\boldsymbol x$$ must be non-negative.

To do this can I instead solve for $$\pm \sqrt{\boldsymbol x}$$ and square it? Specifically, is the following method valid:

1. Replace $$x_i$$ (the $$i_{th}$$ element of $$\boldsymbol x$$) with $$(x'_i)^2$$ in the cost function (where $$x'_i$$ is the $$i_{th}$$ element of the new state vector $$\boldsymbol x'$$).
2. Use Gauss-Newton to find the $$\boldsymbol x'$$ that minimizes the new cost function (with no non-negative constraint).
3. Square each element of $$\boldsymbol x'$$ to yield the $$\boldsymbol x$$ which minimizes the original cost function and satisfies the non-negative constraint.

It seems valid to me but has not performed well when I have tried it.

• Have you tried the transformation like $x_i = \exp(z_i)$ ? – cpraveen Jan 26 at 14:43
• No, I’ll give that a shot soon, thank you for the suggestion. Is there a theoretical basis for why this option would perform better? – specarmi Jan 26 at 16:14
• $x_{1}=exp(z_{i})$ is a one-to-one invertible transformation, while $x_{i}=z_{i}^{2}$ isn't. Your proposed problem transformation creates lots of local minima that may cause problems in the optimization. – Brian Borchers Feb 10 at 23:38