approxerror: Approximate error

approxerrorR Documentation

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)

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.

Author(s)

Irucka Embry

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


library(iemisc)

# Example 4.1 from the Reference text (page 84)

approxerror(1.5, 1) # answer as a percent (\%)




iemisc documentation built on Sept. 25, 2023, 5:09 p.m.