# Second order gradient-based method to locally maximize sum of squares

Non-linear least squares algorithms such as Gauss-Newton allow me to (locally) minimize a sum of squares of residuals (the output of some non-linear function). I.e. locally solve: $$\mathbf{x} = \arg\min_{\mathbf{x}^*} \|\mathbf{f}(\mathbf{x}^*)\|^2,$$ where $$\mathbf{x}$$ is a vector of variables, and $$\mathbf{f}()$$ is a function that outputs a vector of residuals. Assume there are more residuals than variables, so the problem is well conditioned.

The nice thing about least squares solvers is that they offer second-order convergence, but only require the first (not second) derivative of residuals ($$\mathbf{f}(\mathbf{x})$$) to be computed.

Is there a similarly effective (e.g. second-order) algorithm for maximizing a sum of squares, i.e.

$$\mathbf{x} = \arg\max_{\mathbf{x}^*} \|\mathbf{f}(\mathbf{x}^*)\|^2,$$

given only the residuals and their gradient? This is for the case that the residuals are in a finite range (so the cost doesn't zoom off to infinity), and there are no constraints on the variables being optimized.

Note that, while this can be rephrased as $$\mathbf{x} = \arg\min_{\mathbf{x}^*} -\|\mathbf{f}(\mathbf{x}^*)\|^2,$$ it's not clear to me what the update step would be in this case, since Gauss Newton can only be used to minimize a sum of squares, not a negated sum of squares.

I need this for an image alignment problem: I have a scalar field, e.g. an intensity image, and want to maximize the sum of squares of intensity at a predetermined set of sample points, subject to some affine warp of the sample points. I want to find the affine warp that maximizes the sum of squares of the scalar field at the sample points. Note that I want to find a local solution, i.e. the solution I'd get if I did gradient descent from a particular starting point, but with a more efficient, second order algorithm.

If it's not possible, is there an intuitive explanation as to why not?