
Adaptive spectral regularization (internal, F3)
dot-adaptive_spectral_shift.RdImplements Theorem 2 of arXiv:2605.01446 v3 with corrected eigenvalue
estimator. Adds a mu * I shift to Omega_s when its smallest
eigenvalue is numerically negative, so the SMO Hessian is provably PSD
(>= delta_stab * I). Returns the matrix untouched when already PSD.
Value
A list with components:
Omega_useMatrix to pass to the SMO/QP solver.
muNumeric scalar; the shift applied (
0if no shift).lambda_min_hatNumeric scalar; Rayleigh-quotient estimate of
lambda_min(Omega_s)from Pass 2.lambda_max_hatNumeric scalar; Pass 1's Rayleigh quotient. For PSD or
lambda_max-dominant matrices (the typical case for Mercer kernels in this package), this equalslambda_max(Omega_s). Forlambda_min-dominant matrices (|lambda_min| > lambda_max— a pathological case not reachable withmake_kernel()-supplied kernels), it equalslambda_min(Omega_s). The branch decision in either case is made correctly via the Pass 2 estimate oflambda_min_hat.branch_takenCharacter
"no_shift"or"shifted".n_power_iterationsInteger vector of length 2; iterations executed in Pass 1 and Pass 2.
Algorithm and paper deviation
Algorithm 2 line 6 of the paper, as literally written
(v <- -Omega_s * v / ||Omega_s * v||), estimates -lambda_max(Omega_s)
rather than lambda_min(Omega_s): power iteration on -Omega_s
converges to the eigenvector of largest |eigenvalue|, which is
v_max(Omega_s) whenever |lambda_max| > |lambda_min| (the typical
case for Mercer-PSD or near-PSD matrices). This implementation uses the
standard two-pass shifted power iteration: Pass 1 estimates
lambda_max via power iteration on Omega_s; Pass 2 estimates
lambda_min via power iteration on rho * I - Omega_s (whose
dominant eigenvector is v_min(Omega_s)). Both passes are O(N^2); the
total cost is 2 * T_pi matvecs.
The Pass 2 shift uses the spectral radius rho = |Pass 1 Rayleigh|,
not Pass 1's signed Rayleigh. This handles the lambda_min-dominant
pathological case (|lambda_min| > lambda_max), where plain power
iteration on Omega_s in Pass 1 converges to v_min and gives a
negative Rayleigh; using abs(Pass 1 Rayleigh) ensures the shifted
operator rho * I - Omega_s is PSD, so Pass 2 reliably finds
v_min(Omega_s) regardless of which side of the spectrum dominated
Pass 1.