Regularizing Piecewise Constant and Linear Interpolations
Summary
The document asks how to measure and penalize wiggliness when fitting piecewise constant or piecewise linear interpolations. A common smoothness penalty integrates the square of the second derivative, but it does not distinguish these interpolation types because their second derivative is zero almost everywhere. The author wants a measure that approaches the smoothness of the underlying function as knot density increases.
Two existing approaches are described: penalizing the squared first derivative for linear pieces and the sum of squared jumps for constant pieces. The author finds both unsatisfactory and proposes constructing approximate derivatives from differences between knot values and distances, including harmonic means at knots, then using changes in those slopes to estimate curvature. The document poses the problem and sketches a possible construction, but gives no derivation, validation, or recommendation that it is a standard finance method.
Key ideas
- A squared second derivative penalty fails to distinguish piecewise constant and linear interpolations when curvature is zero almost everywhere.
- The author seeks a smoothness measure that converges as interpolation knots become denser.
- Penalizing squared slopes or squared jumps are cited as existing approaches with drawbacks.
- A proposed alternative estimates slopes from knot differences and uses slope changes as approximate curvature.
- The proposal remains exploratory and is not supported by a derivation or empirical evidence.
Tags
Full text
# How do you regularize piecewise constant and linear interpolations? # How do you regularize piecewise constant and linear interpolations? Sometimes you want to regularize the fitting of an interpolation. A conventional way is to minimise the integral of the square of the second derivative (sometimes called "wiggliness" or "curvature"). This works if your interpolation is piecewise quadratic or higher, but not if it's piecewise constant or linear, because the second derivative is almost everywhere zero. So how do you regularize piecewise constant or linear interpolations? Are there any standard approaches in finance? Or even in approximation theory? Ideally, there would be a metric for these interpolations, where if you approximated some function with interpolations with increasing density of knots, as the density went to infinity, the metric would converge on the wiggliness of the approximated function. In the codebase i currently work on, we regularize piecewise linear interpolations by minimising the integral of the square of the first derivative, and piecewise constant interpolations by minimising the sum of the squares of the jumps at the knots. Both of these are unsatisfying for various reasons. I am wondering if i can calculate a fake form of wiggliness for these interpolations by making up a fake second derivative. Say (fake or real) first derivative of a piece = difference between values at knots divided by distance between knots, fake first derivative at a knot = harmonic mean of first derivative on either side, fake second derivative of a piece = difference between fake first derivatives at knots divided by distance between knots.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.