Relative Change and Difference - Formulas

Formulas

Measures of relative difference are unitless numbers expressed as a fraction. Corresponding values of percent difference would be obtained by multiplying these values by 100.

One way to define the relative difference of two numbers is to take their absolute difference divided by the maximum absolute value of the two numbers.


d_r=\frac{|x-y|}{\max(|x|,|y|)}\,

if at least one of the values does not equal zero. This approach is especially useful when comparing floating point values in programming languages for equality with a certain tolerance. Another application is in the computation of approximation errors when the relative error of a measurement is required.

Another way to define the relative difference of two numbers is to take their absolute difference divided by some functional value of the two numbers, for example, the absolute value of their arithmetic mean:


d_r=\frac{|x-y|}{\left(\frac{|x+y|}{2}\right)}\, .

This approach is often used when the two numbers reflect a change in some single underlying entity. A problem with the above approach arises when the functional value is zero. In this example, if x and y have the same magnitude but opposite sign, then


\frac{|x+y|}{2} = 0 ,

which causes division by 0. So it may be better to replace the denominator with the average of the absolute values of x and y:


d_r=\frac{|x-y|}{\left(\frac{|x|+|y|}{2}\right)}\, .

Read more about this topic:  Relative Change And Difference

Famous quotes containing the word formulas:

    That’s the great danger of sectarian opinions, they always accept the formulas of past events as useful for the measurement of future events and they never are, if you have high standards of accuracy.
    John Dos Passos (1896–1970)

    You treat world history as a mathematician does mathematics, in which nothing but laws and formulas exist, no reality, no good and evil, no time, no yesterday, no tomorrow, nothing but an eternal, shallow, mathematical present.
    Hermann Hesse (1877–1962)

    It is sentimentalism to assume that the teaching of life can always be fitted to the child’s interests, just as it is empty formalism to force the child to parrot the formulas of adult society. Interests can be created and stimulated.
    Jerome S. Bruner (20th century)