pysolvegn.arctan_rho#

arctan_rho(x)[source]#

Compute the arctan robust cost function \(\rho(x) = \arctan(x)\) and its derivatives.

\[\rho'(x) = \frac{1}{1 + x^2}\]
\[\rho''(x) = -\frac{2x}{(1 + x^2)^2}\]
Parameters:

x (ArrayLike) – Squared residuals \(x = \|R\|^2\). Shape (N,).

Returns:

  • rho (numpy.ndarray) – The cost function values with shape (N,).

  • rho_prime (numpy.ndarray) – The first derivatives with shape (N,).

  • rho_double_prime (numpy.ndarray) – The second derivatives with shape (N,).

Return type:

Tuple[ndarray, ndarray, ndarray]