Approximation error: Difference between revisions

Content deleted Content added
Clarify wording. Add expansion box for Generalizations section. An example of an approximation error formula using the n-norm would be helpful.
Line 2:
[[File:E^x with linear approximation.png|thumb|Graph of <math>f(x) = e^x</math> (blue) with its linear approximation <math>P_1(x) = 1 + x</math> (red) at a = 0. The approximation error is the gap between the curves, and it increases for x values further from 0.]]
 
The '''approximation error''' in a data value is the discrepancy between an exact value and some ''[[approximation]]'' to it. This error can be expressed as an '''absolute error''' (the numerical amount of the discrepancy) or as a '''relative error''' (the absolute error divided by the data value).
 
An approximation error can occur becausefor a variety of reasons, among them a computing [[machine precision]] or [[measurement error]] (e.g. the length of a piece of paper is 4.53&nbsp;cm but the ruler only allows you to estimate it to the nearest 0.1 cm, so you measure it as 4.5 cm).
 
In the [[mathematics|mathematical]] field of [[numerical analysis]], the [[numerical stability]] of an [[algorithm]] indicates how thean error isoccurring in one of the algorithm's early steps effects errors in other propagatedparts byof the algorithm.
 
==Formal definition==
OneGiven commonlysome distinguishesvalue between''v'' theand relativeits errorapproximation and''v''<sub>approx</sub>, the '''absolute error.''' is
 
Given some value ''v'' and its approximation ''v''<sub>approx</sub>, the '''absolute error''' is
 
:<math>\epsilon = |v-v_\text{approx}|\ ,</math>
Line 25 ⟶ 23:
and the '''percent error''' (an expression of the relative error) is
 
:<math>\delta = 100\%\times\eta = 100\%\times\frac{\epsilon}{|v|} = 100\%\times\left| \frac{v-v_\text{approx}}{v} \right|.</math>
 
In words, the absolute error is the [[Magnitude (mathematics)|magnitude]] of the difference between the exact value and the approximation. The relative error is the absolute error divided by the magnitude of the exact value.
 
An '''error bound''' is an upper limit on the relative or absolute size of an approximation error.
 
===Generalizations===
{{Expand section|date=April 2023}}
These definitions can be extended to the case when <math>v</math> and <math>v_{\text{approx}}</math> are [[Euclidean vector|''n''-dimensional vectors]], by replacing the absolute value with an [[norm (mathematics)|''n''-norm]].<ref name="GOLUB_MAT_COMP2.2.3">{{cite book|last=Golub|first=Gene|author-link=Gene_H._Golub|author2=Charles F. Van Loan|title=Matrix Computations – Third Edition|publisher=The Johns Hopkins University Press|year=1996|___location=Baltimore|pages=53|isbn=0-8018-5413-X}}
</ref>
Line 37 ⟶ 34:
==Examples==
{{Diophantine_approximation_graph.svg}}
As an example, if the exact value is 50 and the approximation is 49.9, then the absolute error is 0.1 and the relative error is 0.1/50 = 0.002 = 0.2%. AnotherAs examplea wouldpractical be ifexample, inwhen measuring a 6&nbsp;mL beaker, the value read was 5&nbsp;mL. The correct reading being 6&nbsp;mL, this means the percent error in that particular situation is, rounded, 16.7%.
 
The relative error is often used to compare approximations of numbers of widely differing size; for example, approximating the number 1,000 with an absolute error of 3 is, in most applications, much worse than approximating the number 1,000,000 with an absolute error of 3; in the first case the relative error is 0.003 andwhile in the second it is only&nbsp;0.000003.
 
There are two features of relative error that should be kept in mind. FirstlyFirst, relative error is undefined when the true value is zero as it appears in the denominator (see below). SecondlySecond, relative error only makes sense when measured on a [[Level_of_measurement#Ratio_scale|ratio scale]], (i.e. a scale which has a true meaningful zero), otherwise it would beis sensitive to the measurement units. For example, when an absolute error in a [[temperature]] measurement given in [[Celsius scale]] is 1&nbsp;°C, and the true value is 2&nbsp;°C, the relative error is 0.5,. and theBut percentif errorthe isexact 50%.same approximation Foris thismade same case, whenwith the temperature is given in [[Kelvin scale]], the samea 1&nbsp;K absolute error with the same true value of 275.15&nbsp;K = 2 °C gives a relative error of 3.63{{e|-3}} and a percent error of only 0.363%. Celsius temperature is measured on an [[Level_of_measurement#Interval_scale|interval scale]], whereas the Kelvin scale has a true zero and so is a ratio scale. Thus the relative error is not very meaningful.
 
==Instruments==