A piecewise linear function agrees with an affine function on each member of a finite or locally finite family of subsets partitioning its domain of a function. On the real line the pieces are intervals; in higher dimensions each piece can be a polyhedron. Here the conventional word “linear” permits a constant offset within each piece.
For example, the absolute value function satisfies for and for . Both branches agree at zero, so the resulting function is continuous, although its derivative changes there. Joining sampled values by linear interpolation gives another common construction. If the partition pieces meet, their formulas must agree on overlaps to define a single function; allowing separate pieces across a jump is a convention that should be stated.
Between two prescribed values, linear interpolation assigns at , for . Joining successive samples produces a piecewise linear function. For a continuous function on a compact interval, interpolants along grids with mesh tending to zero converge in the uniform norm; their error is bounded by the modulus of continuity at the mesh size.
A linear interpolant is the unique polynomial of polynomial degree at most one taking prescribed values at distinct interpolation nodes . It is an affine function, including the constant function case. For , its two displayed coefficients are nonnegative and sum to one, so changing each sampled value by at most changes every interpolated value by at most . Differentiation instead uses the difference of the two samples divided by , causing noise amplification by differentiation of a linear interpolant.
Articles by others on the same topic
A piecewise linear function is a function composed of multiple linear segments. Each segment is defined by a linear equation over a specific interval in its domain. Essentially, the function "pieces together" several lines to create a graph that can take various forms depending on the specified intervals and the slopes of the lines.