Skip to content

Data and Computational Error

Definition

Some errors can be attributed to input data, and others from subsequent computational processes. We need to examine the overall effects of approximations in both of these cases.

Let's take a simple problem where we have a function \(f: \mathbb{R} \to \mathbb{R}\), that maps a given input to an output result. We denote the true input value to be \(x\), and so the desired true result is \(f(x)\).

Then say we have an inexact input \(\hat{x}\) and we take an approximation function \(\hat{f}\). Then our total error is:

\[ \begin{align} \text{total error} &= \hat{f}(\hat{x}) - f(x) \\ & = \ \ \ \ \ (\hat{f}(\hat{x}) - f(\hat{x}))\ \ \ \ \ \ + \ \ \ \ \ \ (f(\hat{x}) - f(x)) \\ & = \text{computational error} + \text{propagated data error} \end{align} \]

Computational error arises from our function \(\hat{f}\) being inaccurate from the true function function \(f\), regardless of the input.

Data error is the difference between the true input \(x\) and our approximated input \(\hat{x}\). Even though we have the true function, we still result in some error from the true result. The choice of the algorithm \(f\) has no impact on the data error.

We can further subdivide computational error into (Truncation Error and Rounding Error (numerical analysis)):

  1. Truncation Error
  2. Rounding Error

Example

Suppose we want to approximate \(\sin\left( \frac{\pi}{8} \right)\).

Since \(\pi\) is a transient number, we decide to round it. For simplicities sake we say \(\pi \approx 3\).

Next, we want to approximate \(\sin\). Note that a decent approximation is taking the first term of the Taylor series expansion, which for \(\sin(x)\) is \(x\). Then our final result is:

\[ \sin\left( \frac{\pi}{8} \right) \approx \sin\left( \frac{3}{8} \right) \approx \frac{3}{8} = 0.3750. \]

The first approximation is that we use an approximated input \(\hat{x} = 3 / 8\) instead of the true value \(x = \pi / 8\), which induces the propagated data error. Regardless of the fact that we use the true function \(\sin\), we still obtain the wrong result, due to an approximated input.

The second approximation comes from letting \(\sin(x) \approx x\). This is the computational error since regardless if we had used the true input \(x\), we would still obtained the wrong result due to using an approximation of the function \(\sin\).

Now, we use a calculator and find out that, to four decimals: \(\sin(\pi / 8) = 0.3827\).

Then, our total error is:

\[ \begin{align} \text{total error} &= \hat{f}(\hat{x}) - f(x) \\ &= 0.3750 - 0.3827 \\ &= -0.0077 \end{align} \]

We can also calculate the data error and computational error:

\[ \begin{align} \text{data error} &= f(\hat{x}) - f(x) \\ &= \sin(3 / 8) - \sin(\pi / 8) \\ &\approx 0.3663 - 0.3827 \\ & = -0.0164 \\ \end{align} \]
\[ \begin{align} \text{computational error} &= \hat{f}(\hat{x}) - f(\hat{x}) \\ &= 3 / 8 - \sin(3 /8) \\ & \approx 0.3750 - 0.3663 \\ &= 0.0087 \end{align} \]

Then, by adding the computation and data error, we obtain the total error.