Comparing a function and its estimate

25 Views Asked by At

What are some clever ways of comparing (visually) a function with its estimate?

For regions where the function does not cross zero, plotting the ratio of the functions and plotting the relative error of the estimate gives a good idea. However when the function crosses zero, even worse, when the function is oscillatory; the plot loses its meaning.

enter image description here

I realize that the unbounded relative error near the zeros is sometimes important but for this question assume it is not important.

1

There are 1 best solutions below

0
On

I have a clever (I believe) way of handling such a comparison. I compare the ratio of the hilbert transforms of the estimate and the true answer.

Of course there are some practical concerns as to how one would perform hilbert for purely numerical estimates, however this can work well for closed form asymptotic estimates

Example Comparing Bessel $J_0(x)$ and $\frac{\sqrt{\frac{2}{\pi }} \sin \left(x+\frac{\pi }{4}\right)}{\sqrt{x}}$

The ratio of the estimate and the real answer

enter image description here

The ratio of their hilbert transforms

enter image description here