pyFDN.nearest_sign_agnostic_orthogonal#

pyFDN.nearest_sign_agnostic_orthogonal(A, max_trials=100000, tol=2.220446049250313e-11, *, rng=None)[source]#

Find the orthogonal matrix U minimising ‖A − |U|‖_F.

Solves the non-convex problem by repeated random restarts followed by a sign-variable-exchange local search.

Parameters:
  • A (ndarray) – Input square matrix, shape (N, N). Signs are ignored.

  • max_trials (int) – Number of random sign-pattern restarts.

  • tol (float) – Stop early when the Frobenius error is below this value.

  • rng (Generator | int | None) – Generator or integer seed for the random restarts.

Returns:

Orthogonal matrix of shape (N, N).

Return type:

ndarray