Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Piecewise linear function

From Wikipedia, the free encyclopedia
Type of mathematical function
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Piecewise linear function" – news ·newspapers ·books ·scholar ·JSTOR
(March 2013) (Learn how and when to remove this message)
For other uses of "piecewise linear", seePiecewise linear (disambiguation).

Inmathematics, apiecewise linear orsegmented function is areal-valued function of a real variable, whosegraph is composed of straight-line segments.[1]

Definition

[edit]

A piecewise linear function is a function defined on a (possibly unbounded)interval ofreal numbers, such that there is a collection of intervals on each of which the function is anaffine function. (Thus "piecewise linear" is actually defined to mean "piecewiseaffine".) If the domain of the function iscompact, there needs to be a finite collection of such intervals; if the domain is not compact, it may either be required to be finite or to belocally finite in the reals.

Examples

[edit]
A continuous piecewise linear function

The function defined by

f(x)={x3if x3x+3if 3<x<02x+3if 0x<30.5x4.5if x3{\displaystyle f(x)={\begin{cases}-x-3&{\text{if }}x\leq -3\\x+3&{\text{if }}-3<x<0\\-2x+3&{\text{if }}0\leq x<3\\0.5x-4.5&{\text{if }}x\geq 3\end{cases}}}

is piecewise linear with four pieces. The graph of this function is shown to the right. Since the graph of an affine(*) function is aline, the graph of a piecewise linear function consists ofline segments andrays. Thex values (in the above example −3, 0, and 3) where the slope changes are typically called breakpoints, changepoints, threshold values or knots. As in many applications, this function is also continuous. The graph of a continuous piecewise linear function on a compact interval is apolygonal chain.

(*) Alinear function satisfies by definitionf(λx)=λf(x){\displaystyle f(\lambda x)=\lambda f(x)} and therefore in particularf(0)=0{\displaystyle f(0)=0}; functions whose graph is a straight line areaffine rather thanlinear.

There are other examples of piecewise linear functions:

Fitting to a curve

[edit]
A function (blue) and a piecewise linear approximation to it (red)

An approximation to a known curve can be found by sampling the curve and interpolating linearly between the points. An algorithm for computing the most significant points subject to a given error tolerance has been published.[3]

Fitting to data

[edit]
Main article:Segmented regression

If partitions, and then breakpoints, are already known,linear regression can be performed independently on these partitions. However, continuity is not preserved in that case, and also there is no unique reference model underlying the observed data. A stable algorithm with this case has been derived.[4]

If partitions are not known, theresidual sum of squares can be used to choose optimal separation points.[5] However efficient computation and joint estimation of all model parameters (including the breakpoints) may be obtained by an iterative procedure[6] currently implemented in the packagesegmented[7] for theR language.

A variant ofdecision tree learning calledmodel trees learns piecewise linear functions.[8]

Generalizations

[edit]
A piecewise linear function of two arguments (top) and the convex polytopes on which it is linear (bottom)

The notion of a piecewise linear function makes sense in several different contexts. Piecewise linear functions may be defined onn-dimensionalEuclidean space, or more generally anyvector space oraffine space, as well as onpiecewise linear manifolds andsimplicial complexes (seesimplicial map). In each case, the function may bereal-valued, or it may take values from a vector space, an affine space, a piecewise linear manifold, or a simplicial complex. (In these contexts, the term “linear” does not refer solely tolinear transformations, but to more generalaffine linear functions.)

In dimensions higher than one, it is common to require the domain of each piece to be apolygon orpolytope. This guarantees that the graph of the function will be composed of polygonal or polytopal pieces.

Splines generalize piecewise linear functions to higher-order polynomials, which are in turn contained in the category of piecewise-differentiable functions,PDIFF.

Specializations

[edit]

Important sub-classes of piecewise linear functions include thecontinuous piecewise linear functions and theconvex piecewise linear functions.In general, for everyn-dimensional continuous piecewise linear functionf:RnR{\displaystyle f:\mathbb {R} ^{n}\to \mathbb {R} }, there is a

ΠP(P(Rn+1)){\displaystyle \Pi \in {\mathcal {P}}({\mathcal {P}}(\mathbb {R} ^{n+1}))}

such that

f(x)=minΣΠmax(a,b)Σax+b.{\displaystyle f({\vec {x}})=\min _{\Sigma \in \Pi }\max _{({\vec {a}},b)\in \Sigma }{\vec {a}}\cdot {\vec {x}}+b.}[9]

Iff{\displaystyle f} is convex and continuous, then there is a

ΣP(Rn+1){\displaystyle \Sigma \in {\mathcal {P}}(\mathbb {R} ^{n+1})}

such that

f(x)=max(a,b)Σax+b.{\displaystyle f({\vec {x}})=\max _{({\vec {a}},b)\in \Sigma }{\vec {a}}\cdot {\vec {x}}+b.}

Applications

[edit]
Crop response to depth of the watertable[10]
Example of crop response to soil salinity[11]

Inagriculture piecewiseregression analysis of measured data is used to detect the range over which growth factors affect the yield and the range over which the crop is not sensitive to changes in these factors.

The image on the left shows that at shallowwatertables the yield declines, whereas at deeper (> 7 dm) watertables the yield is unaffected. The graph is made using the method ofleast squares to find the two segments with thebest fit.

The graph on the right reveals that crop yieldstolerate asoil salinity up to ECe = 8 dS/m (ECe is the electric conductivity of an extract of a saturated soil sample), while beyond that value the crop production reduces. The graph is made with the method of partial regression to find the longest range of "no effect", i.e. where the line is horizontal. The two segments need not join at the same point. Only for the second segment method of least squares is used.

See also

[edit]

Further reading

[edit]

References

[edit]
  1. ^Stanley, William D. (2004).Technical Analysis And Applications With Matlab. Cengage Learning. p. 143.ISBN 978-1401864811.
  2. ^abWeisstein, Eric W."Piecewise Function".mathworld.wolfram.com. Retrieved2020-08-24.
  3. ^Hamann, B.; Chen, J. L. (1994)."Data point selection for piecewise linear curve approximation"(PDF).Computer Aided Geometric Design.11 (3): 289.doi:10.1016/0167-8396(94)90004-3.
  4. ^Golovchenko, Nikolai."Least-squares Fit of a Continuous Piecewise Linear Function". Retrieved6 Dec 2012.
  5. ^Vieth, E. (1989). "Fitting piecewise linear regression functions to biological responses".Journal of Applied Physiology.67 (1):390–396.doi:10.1152/jappl.1989.67.1.390.PMID 2759968.
  6. ^Muggeo, V. M. R. (2003). "Estimating regression models with unknown break-points".Statistics in Medicine.22 (19):3055–3071.doi:10.1002/sim.1545.PMID 12973787.S2CID 36264047.
  7. ^Muggeo, V. M. R. (2008)."Segmented: an R package to fit regression models with broken-line relationships"(PDF).R News (FTP). pp. 20–25.[dead ftp link](To view documents seeHelp:FTP)
  8. ^Landwehr, N.; Hall, M.; Frank, E. (2005)."Logistic Model Trees"(PDF).Machine Learning.59 (1–2):161–205.doi:10.1007/s10994-005-0466-3.S2CID 6306536.
  9. ^Ovchinnikov, Sergei (2002). "Max-min representation of piecewise linear functions".Beiträge zur Algebra und Geometrie.43 (1):297–302.arXiv:math/0009026.MR 1913786.
  10. ^A calculator for piecewise regression.
  11. ^A calculator for partial regression.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Piecewise_linear_function&oldid=1292516852"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp