Finding relative error between two curves

214 Views Asked by At

I want to find the relative error between the curve $f(x)$ and some approximation curve $g(x)$ in $[a,b]$.

Is it alright to use the integral as shown below:

$$\frac{\int_{a}^{b}|f(x)-g(x)|dx}{\int_{a}^{b}|f(x)|dx}$$

I would also like to know whether there is any academic term for this? Any articles using/explaining this will also be appreciated.

1

There are 1 best solutions below

2
On BEST ANSWER

Small observation:
The formula you wrote can be seen by eye that it is wrong because the denominator could potentially be $0$. (At most you should put $\int |f|$)

However, in general you can consider two types of relative errors:

  1. If $g(x)$ is an approximation of $f(x)$ the relative error you can consider

$$\text{max.rel.err.}=\max_{x\in[a,b]}\frac{|f(x)-g(x)|}{|f(x)|}$$

  1. Or the average relative error:

$$\text{av.rel.err}=\frac{1}{n}\sum_{i=1}^{n}\frac{|f(x_i)-g(x_i)|}{|f(x_i)|}\qquad \text{where }x_i=a+i\frac{b-a}{n}$$

For $n\to \infty$ you have

$$\text{rel.err}=\frac{1}{b-a}\int_{a}^{b}\frac{|f(t)-g(t)|}{|f(t)|}\mathrm{d}t$$