Approximation: Difference between revisions

From wiki
Jump to navigation Jump to search
Created page with "The [https://en.wikipedia.org/wiki/Approximation_error Approximation error] ([https://nl.wikipedia.org/wiki/Benaderingsfout benaderingsfout]) is the difference between a calcu..."
 
mNo edit summary
 
Line 1: Line 1:
The [https://en.wikipedia.org/wiki/Approximation_error Approximation error] ([https://nl.wikipedia.org/wiki/Benaderingsfout benaderingsfout]) is the difference between a calculated value and the real value. By dividing it by the real value you get the relative error. A bit relative error indicates bad calculation.
The [https://en.wikipedia.org/wiki/Approximation_error Approximation error] ([https://nl.wikipedia.org/wiki/Benaderingsfout benaderingsfout]) is the difference between a calculated value and the real value. By dividing it by the real value you get the relative error. A bit relative error indicates bad calculation.
The largest relative error between two arrays as percentage:
The largest relative error between two arrays as percentage:
<syntaxhighlight lang=python>
<syntaxhighlight lang=python>

Latest revision as of 20:26, 25 December 2018

The Approximation error (benaderingsfout) is the difference between a calculated value and the real value. By dividing it by the real value you get the relative error. A bit relative error indicates bad calculation.

The largest relative error between two arrays as percentage:

np.mean(abs(calculated - real))                  # Average of the absolute errors 
np.mean(abs(calculated - real) / real )          # Average of the differences relative to the real values
np.mean(abs(calculated - real) / real ) * 100    # The relative error as percentage.