approxerror: Approximate error

Description Usage Arguments Details Value References See Also Examples

Description

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

Usage

1
approxerror(pres, prev)

Arguments

pres

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

prev

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

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"

Value

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

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

1
2
3
library("iemisc")
# Example 4.1 from the Reference text (page 84)
approxerror(1.5, 1) # answer as a percent (\%)

iemisc documentation built on Aug. 2, 2020, 9:07 a.m.