Projects/Foundations/Adaptive quadrature versus Gauss-Legendre for oscillatory integrals — real-data stress test
Level 5 · research · ~13 h
Adaptive quadrature versus Gauss-Legendre for oscillatory integrals — real-data stress test
Evaluate a family of highly oscillatory integrals with Simpson, adaptive Simpson and fixed-order Gauss-Legendre, and record cost against accuracy. Repeat on a real dataset, report a table with confidence intervals over three trials, and explain which assumption broke.
Prerequisites
Problem statement
- 01Evaluate a family of highly oscillatory integrals with Simpson, adaptive Simpson and fixed-order Gauss-Legendre, and record cost against accuracy. Repeat on a real dataset, report a table with confidence intervals over three trials, and explain which assumption broke.
Real-world motivation
- 01Oscillation defeats low-order polynomial rules and exposes the cost-accuracy tradeoff in adaptive refinement. The real-data stress test setting forces concrete choices about data, scale and evaluation.
Learning objectives
- 01Implement three quadrature rules
- 02Measure function evaluations
- 03Explain failure at high frequency
- 04Report wall-clock seconds on one pinned CPU core alongside the baseline metrics.
Technical architecture
- 01fixed Simpson grid
- 02adaptive bisection with error estimate
- 03Gauss-Legendre nodes via numpy.polynomial
Mathematical foundations
- 01adaptive error estimate $E=|S_{2h}-S_h|/15$
- 02Gauss-Legendre exactness degree $2m-1$ for $m$ nodes
Dataset and sources
- 01MNIST 70k subset
- 02UCI Sparse Matrix collection
Step-by-step tasks
- 01Frame the task and freeze the real-data stress test evaluation protocol with a fixed random seed.
- 02Implementation 1: Implement recursive adaptive Simpson with a depth cap
- 03Implementation 2: Use known analytic truth values
- 04Implementation 3: Sweep frequency from 1 to 1000
- 05Verification 1: Check exactness on polynomials of degree up to 2m-1
- 06Verification 2: Verify error estimate bounds true error
- 07Run the ablation grid and report wall-clock seconds on one pinned CPU core over three independent trials.
Implementation requirements
- 01Implement recursive adaptive Simpson with a depth cap
- 02Use known analytic truth values
- 03Sweep frequency from 1 to 1000
- 04Log all hyperparameters and the random seed for the real-data stress test run.
Testing requirements
- 01Check exactness on polynomials of degree up to 2m-1
- 02Verify error estimate bounds true error
- 03Measure wall-clock seconds on one pinned CPU core over at least three seeds.
Evaluation metrics
- 01absolute error
- 02function evaluations
- 03wall-clock time
- 04wall-clock seconds on one pinned CPU core
Expected outputs
- 01error-versus-frequency plot
- 02cost table
Common failure modes
- 01adaptive Simpson misses oscillations when the initial sample aliases
- 02Gauss rule needs many nodes at high frequency
- 03real data violates the synthetic noise model and the baseline overfits
Stretch goals
- 01implement Clenshaw-Curtis
- 02use Filon quadrature for oscillatory integrands
- 03profile the method with cProfile and report the dominant kernel
Research extensions
- 01derive node counts for a target accuracy
- 02study aliasing in adaptive schemes
GitHub submission requirements
- 01A repository whose README states the real-data stress test protocol and the exact command to reproduce it.
- 02Source for the scratch implementation, a test file, and a results table with uncertainty estimates.
- 03A two-page report explaining failures on MNIST 70k subset and what the ablation revealed.
Completion rubric
- 01rules implemented correctly
- 02cost measured
- 03aliasing diagnosed
- 04Extra credit: profile the method with cProfile and report the dominant kernel
Submit when every rubric item is satisfied and your repository contains runnable code plus a reproduction command.