Table of Contents
Fetching ...

Fitting an Escalier to a Curve

Sebastien Bossu, Andrew Papanicolaou, Nour El Hatto

TL;DR

The paper addresses approximating a target function $f$ in $L^2([a,b])$ by an escalier (step) function with $n$ steps, optimizing the fit by solving a linear LS subproblem when step positions are fixed and then optimizing the knot locations via nonlinear first-order conditions. It introduces a recursive, sweep-based optimization algorithm that recovers the global optimum by exploiting a three-term recurrence for the knots and a terminal condition, and provides a detailed numerical implementation with tests on a mix of smooth and discontinuous functions. Theoretical results include an explicit linear LS solution with a tridiagonal inverse Gram matrix, an $R^2$-based objective, and asymptotic/error bounds showing $O(1/n)$ SSE convergence under regularity; the nonlinear stage yields convergence characteristics and a practical algorithm, while numerical experiments demonstrate speedups over brute-force in low dimensions and scalable performance for higher step counts, highlighting interplay between precision, tolerance, and function structure. The work offers a principled, parsimonious approach to piecewise-constant approximation in $L^2$ with potential relevance to activation-function modeling, Haar-like decompositions, and fast surrogate fittings in signal processing and ML contexts, complemented by open-source C++ code.

Abstract

We analyze the problem of fitting a fonction en escalier or multi-step function to a curve in L^2 Hilbert space. We propose a two-stage optimization approach whereby the step positions are initially fixed, corresponding to a classic linear least-squares problem with closed-form solution, and then are allowed to vary, leading to first-order conditions that can be solved recursively. We find that, subject to regularity conditions, the speed of convergence is linear as the number of steps $n$ goes to infinity, and we develop a simple algorithm to recover the global optimum fit. Our numerical results based on a sweep search implementation show promising performance in terms of speed and accuracy.

Fitting an Escalier to a Curve

TL;DR

The paper addresses approximating a target function in by an escalier (step) function with steps, optimizing the fit by solving a linear LS subproblem when step positions are fixed and then optimizing the knot locations via nonlinear first-order conditions. It introduces a recursive, sweep-based optimization algorithm that recovers the global optimum by exploiting a three-term recurrence for the knots and a terminal condition, and provides a detailed numerical implementation with tests on a mix of smooth and discontinuous functions. Theoretical results include an explicit linear LS solution with a tridiagonal inverse Gram matrix, an -based objective, and asymptotic/error bounds showing SSE convergence under regularity; the nonlinear stage yields convergence characteristics and a practical algorithm, while numerical experiments demonstrate speedups over brute-force in low dimensions and scalable performance for higher step counts, highlighting interplay between precision, tolerance, and function structure. The work offers a principled, parsimonious approach to piecewise-constant approximation in with potential relevance to activation-function modeling, Haar-like decompositions, and fast surrogate fittings in signal processing and ML contexts, complemented by open-source C++ code.

Abstract

We analyze the problem of fitting a fonction en escalier or multi-step function to a curve in L^2 Hilbert space. We propose a two-stage optimization approach whereby the step positions are initially fixed, corresponding to a classic linear least-squares problem with closed-form solution, and then are allowed to vary, leading to first-order conditions that can be solved recursively. We find that, subject to regularity conditions, the speed of convergence is linear as the number of steps goes to infinity, and we develop a simple algorithm to recover the global optimum fit. Our numerical results based on a sweep search implementation show promising performance in terms of speed and accuracy.
Paper Structure (23 sections, 50 equations, 7 figures, 5 tables, 1 algorithm)

This paper contains 23 sections, 50 equations, 7 figures, 5 tables, 1 algorithm.

Figures (7)

  • Figure 1: Two-step optimal escalier fit to a curve
  • Figure 2: Approximation plot of $f_8$ with tolerance and precision = $10^{-3}$
  • Figure 3: Log–log plots of runtime (ms) against precision for Escalier and Brute Force algorithms, $N_{\max}=3$, tolerance =$10^{-3}$
  • Figure 4: Group II graph comparison for default tolerance and precision of $10^{-3}$ and $N_{\max}=3$.
  • Figure 5: Tolerance vs R2 for $f_6$ and $f_7$ with $N_{\max} =3$
  • ...and 2 more figures