projects / proj-math-006
Next task →
Projects/Foundations/Runge phenomenon and Chebyshev interpolation — real-data stress test
Level 3 · intermediate · ~11 h

Runge phenomenon and Chebyshev interpolation — real-data stress test

Interpolate the Runge function with equispaced and Chebyshev nodes for n=5..40 and demonstrate the divergence of the first and convergence of the second. Repeat on a real dataset, report a table with confidence intervals over three trials, and explain which assumption broke.
Add to portfolio →
Prerequisites

Problem statement

  • 01Interpolate the Runge function with equispaced and Chebyshev nodes for n=5..40 and demonstrate the divergence of the first and convergence of the second. Repeat on a real dataset, report a table with confidence intervals over three trials, and explain which assumption broke.

Real-world motivation

  • 01Node placement, not polynomial degree alone, determines interpolation quality. The real-data stress test setting forces concrete choices about data, scale and evaluation.

Learning objectives

  • 01Implement barycentric interpolation
  • 02Compare node families
  • 03Plot Lebesgue constants
  • 04Report wall-clock seconds on one pinned CPU core alongside the baseline metrics.

Technical architecture

  • 01barycentric weights for each node family
  • 02evaluation on a dense grid
  • 03Lebesgue constant estimator

Mathematical foundations

  • 01$\ell_j(x)=\frac{w_j/(x-x_j)}{\sum_k w_k/(x-x_k)}$ with barycentric weights $w_j$
  • 02Lebesgue constant $\Lambda_n=\max_x\sum_j|\ell_j(x)|$

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: Compute weights in O(n^2)
  • 03Implementation 2: Vectorize evaluation over a 10k-point grid
  • 04Implementation 3: Estimate max error on the grid
  • 05Verification 1: Verify interpolation at nodes to machine precision
  • 06Verification 2: Check partition of unity sum(ell_j)=1
  • 07Run the ablation grid and report wall-clock seconds on one pinned CPU core over three independent trials.

Implementation requirements

  • 01Compute weights in O(n^2)
  • 02Vectorize evaluation over a 10k-point grid
  • 03Estimate max error on the grid
  • 04Log all hyperparameters and the random seed for the real-data stress test run.

Testing requirements

  • 01Verify interpolation at nodes to machine precision
  • 02Check partition of unity sum(ell_j)=1
  • 03Measure wall-clock seconds on one pinned CPU core over at least three seeds.

Evaluation metrics

  • 01max interpolation error
  • 02Lebesgue constant
  • 03wall-clock seconds on one pinned CPU core

Expected outputs

  • 01overlay plot of interpolants
  • 02error versus n curve

Common failure modes

  • 01barycentric formula divides by zero at nodes without special handling
  • 02high-degree equispaced interpolation diverges near endpoints
  • 03real data violates the synthetic noise model and the baseline overfits

Stretch goals

  • 01implement Clenshaw-Curtis quadrature from the same nodes
  • 02test piecewise cubic splines
  • 03profile the method with cProfile and report the dominant kernel

Research extensions

  • 01derive the exponential growth rate of the Lebesgue constant
  • 02study least-squares polynomial fits as an alternative

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

  • 01barycentric weights correct
  • 02both node families tested
  • 03divergence explained by node density
  • 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.