The K-COS MethodReading edition

Adaptive evaluation and numerical interfaces

Reading tools
Reading libraryFind statementsInspect Lean
Switch work

Saved reading

Read side by side

Start reading

Resources & source

Original TeX with line links · Download TeX

The wording and mathematics follow the retained manuscript. This reading format does not add a proof review or extend Lean coverage.

Skip contents and start reading

8 Adaptive evaluation and numerical interfaces

An adaptive solver should refine the representation responsible for the largest unresolved error. The planner described here chooses packets, support, and modes jointly. Its floating implementation retains an analytic ledger. The next part supplies the stricter contract in which finite arithmetic and output serialization are enclosed as well.

8.1 Adaptive K-COS algorithm

The packet planner accepts a finite positive spectrum, an upper-tail query \(q>\sum_j\lambda_j\), and a requested relative tolerance \(\tau>0\). Its initial support parameter satisfies \(L>0\), and its mode count is a positive integer.

  1. Solve \(\kappa'(\theta_*)=q\).

  2. Initialize an upper interval \(b=q+L\sqrt{\kappa''(\theta_*)+\sqrt{\kappa^{(4)}(\theta_*)}}\) and a mode count \(N\).

  3. Retain the largest spectral spikes exactly and place the remaining sorted eigenvalues into coarse packets.

  4. Evaluate \(\rho_P(\theta_*+{\mathrm{i}} u_k)\) and the packet remainder bound on the actual COS grid. Split packets until the propagated packet contribution is within its budget.

  5. Evaluate the support/alias certificate from (7.7)–(7.9).

  6. Evaluate the omitted-mode certificate (7.15).

  7. If the combined relative certificate exceeds \(\tau\), refine whichever analytic error source dominates: split packets, increase \(b\), or increase \(N\).

  8. Return a certified analytic result only after the combined bound meets \(\tau\). Return the tail estimate, the compiled spectral representation, and its error ledger together. If resource limits are reached first, report failure to certify rather than accepting the estimate.

The resulting object is query dependent. Schematically,

\[ (\Lambda,q,\tau) \longmapsto \mathcal P_{\Lambda,q,\tau} \longmapsto (\widehat p,\text{certificate}), \]
(8.1)

where \(\mathcal P_{\Lambda,q,\tau}\) stores exact spikes, packet centers, centered moments, packet radii, and the selected COS parameters.

8.2 Numerical interfaces and log-domain evaluation

The preceding mathematics is exposed through a domain-neutral engine rather than through a SKAT-only entry point. The central positive engine accepts:

  • an explicit nonnegative spectrum.

  • a positive semidefinite matrix.

  • a dense factor \(A\).

  • a replayable streamed column-factor source.

  • or a covariance/quadratic-matrix pair \((\Sigma,M)\).

A signed central engine accepts a signed spectrum, a symmetric operator, or

\[ (\Sigma,M),\qquad M=M^\top, \]

and performs the exact central-indefinite reduction proved in Chapter 1. A separate noncentral positive engine accepts

\[ (\mu,\Sigma,M),\qquad M\succeq0, \]

and performs the corresponding noncentral reduction.

8.2.1 Log-domain packet error accumulation

After separating the likelihood-ratio prefactor, the packet contribution contains sums of the form

\[ \frac{2}{b} \sum_k |J_k| \left( e^{\varepsilon_k}-1 \right). \]

Direct evaluation can overflow even when the candidate is destined to be rejected by the adaptive planner. The implementation instead computes

\[ \log\left( \frac{2}{b} \sum_k |J_k| \left( e^{\varepsilon_k}-1 \right) \right) \]

by log-sum-exp arithmetic, and compares this quantity with the logarithm of the requested tolerance before converting a final accepted bound back to float64.

This change does not weaken the mathematical bound. It changes only its floating-point representation.

8.2.2 Reference convergence is part of verification

An independently evaluated reference is useful only if its own numerical resolution has converged. In a rank-350 deep-tail audit, an initial fixed-grid reference appeared to disagree with the adaptive answer. Increasing the reference COS grid gave absolute discrepancies of approximately

\[ 1.88\times10^{-2}, \quad 2.6\times10^{-3}\text{--}4.0\times10^{-3}, \quad 1.39\times10^{-4}, \quad 2.60\times10^{-8} \]

decades as the grid was refined through

\[ N=4096,\ 8192,\ 16384,\ 32768. \]
The adaptive result is compared with progressively refined full-spectrum references. The reference discrepancy is not monotone across the intermediate grids. Its final recorded value is approximately -2.60 times 10 -8 decades, illustrating why a reference needs its own convergence check.
Figure 8.1. The adaptive result is compared with progressively refined full-spectrum references. The reference discrepancy is not monotone across the intermediate grids. Its final recorded value is approximately \(-2.60\times10^{-8}\) decades, illustrating why a reference needs its own convergence check.

View full-size figure (new tab)

The numerical verification rule is consequently two-sided: the adaptive solver must satisfy its own certificate, and any external or fixed-grid reference used for comparison must demonstrate numerical convergence.

Source and conversion record

Source SHA-256: 20818e20f195c7c3a3a530327747389b96dfeb393c998889e7ba45c16f2be310

Unsupported prose commands stop the build. The mathematical expression sequence is checked against the source, with manuscript macros expanded for display.

Conversion records

Notation in The K-COS Method

Look up a symbol without leaving this chapter. Select text before opening help to search for it.

Search this work’s notation.

    Symbols can have different meanings in different passages. Read each result in its own context.

    Open the full notation index