Learn R Programming

iemisc (version 0.5.0)

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.

encoding

UTF-8

Details

Approximate error is expressed as

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

[object Object],[object Object],[object Object]

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
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