iemisc (version 0.9.8)

approxerror: Approximate error

Description

This function computes the "approximate estimate of the error" ("percent relative error").

Usage

approxerror(pres, prev)

Arguments

pres

numeric vector that contains the "present approximation" value(s)

prev

numeric vector that contains the "previous approximation" value(s)

Value

approximate error, as a percent (%), as a numeric vector.

Details

Approximate error is expressed as

$$\varepsilon_{a} = \frac{{present \: approximation} - {previous \: approximation}}{present \: approximation} \cdot 100$$

\(\varepsilon_a\)

the "approximate estimate of the error"

present approximation

the "present approximation"

previous approximation

the "previous approximation"

References

Steven C. Chapra, Applied Numerical Methods with MATLAB for Engineers and Scientists, Second Edition, Boston, Massachusetts: McGraw-Hill, 2008, page 82-84.

See Also

sgm for geometric mean, shm for harmonic mean, cv for coefficient of variation (CV), rms for root-mean-square (RMS), relerror for relative error, and ranges for sample range.

Examples

Run this code
# NOT RUN {
library("iemisc")
# Example 4.1 from the Reference text (page 84)
approxerror(1.5, 1) # answer as a percent (\%)



# }

Run the code above in your browser using DataLab