- #1
AnnapolisStar
- 2
- 0
I am trying to compute the inverse Fourier transform numerically (using a DFT) for some complicated characteristic functions in order to compute their corresponding probability distribution functions. As a test case I thought I would invert the characteristic function for the simple exponential distribution but my resulting distribution function evaluated at x=0is off by a factor of 2.
Specifically if I evaluate the integral analytically first (which I can do for the simple integral) and then plug in x= 0 I get the correct answer
[tex]f(x) = {\textstyle{1 \over {2\pi }}}\int\limits_{ - \infty }^\infty {{e^{ - iux}}{\textstyle{\alpha \over {\alpha - iu}}}} du = \alpha {e^{ - \alpha x}} = \alpha [/tex]
[tex]f(x) = {\textstyle{1 \over {2\pi }}}\int\limits_{ - \infty }^\infty {{e^{ - iux}}{\textstyle{\alpha \over {\alpha - iu}}}} du = \alpha {e^{ - \alpha x}} = \alpha [/tex]
[tex]f(x) = {\textstyle{1 \over {2\pi }}}\int\limits_{ - \infty }^\infty {{e^{ - iux}}{\textstyle{\alpha \over {\alpha - iu}}}} du = \alpha {e^{ - \alpha x}} = \alpha [/tex]
If I substitute x = 0 first before integrating (as you must do with any numerical algorithm for which you don't know the integral apriori) and then evaluate the integral numerically or analytically (which you can do in this simple case) you will get the wrong answer.
[tex]f(0) = {\textstyle{1 \over {2\pi }}}\int\limits_{ - \infty }^\infty {{\textstyle{\alpha \over {\alpha - iu}}}} du = \alpha /2[/tex]
It is off by a factor of two! It is not just at zero either - the answer is wrong but progressively better for larger x values. Since this integral gives the same wrong answer either numerically or analytically I know it is not a round off problem
This seems to be a common problem with a lot of distributions. Interestingly when I look at algorithms in "Numerical Receipes Art of Programming" for computing the Fourier transform with a DFT or when I look at the considerable literture on the web for evaluating Fourier transforms numerically they never seem to mention this problem and they get lost in the mathematics of fractional FFT's and Kernal functions etc. This seems to be a major problem with any numerical procedure for Fourier transforms and a problem common to a lot of distribution functions which exhibit discontinuities.
How do you handle this?
Specifically if I evaluate the integral analytically first (which I can do for the simple integral) and then plug in x= 0 I get the correct answer
[tex]f(x) = {\textstyle{1 \over {2\pi }}}\int\limits_{ - \infty }^\infty {{e^{ - iux}}{\textstyle{\alpha \over {\alpha - iu}}}} du = \alpha {e^{ - \alpha x}} = \alpha [/tex]
[tex]f(x) = {\textstyle{1 \over {2\pi }}}\int\limits_{ - \infty }^\infty {{e^{ - iux}}{\textstyle{\alpha \over {\alpha - iu}}}} du = \alpha {e^{ - \alpha x}} = \alpha [/tex]
[tex]f(x) = {\textstyle{1 \over {2\pi }}}\int\limits_{ - \infty }^\infty {{e^{ - iux}}{\textstyle{\alpha \over {\alpha - iu}}}} du = \alpha {e^{ - \alpha x}} = \alpha [/tex]
If I substitute x = 0 first before integrating (as you must do with any numerical algorithm for which you don't know the integral apriori) and then evaluate the integral numerically or analytically (which you can do in this simple case) you will get the wrong answer.
[tex]f(0) = {\textstyle{1 \over {2\pi }}}\int\limits_{ - \infty }^\infty {{\textstyle{\alpha \over {\alpha - iu}}}} du = \alpha /2[/tex]
It is off by a factor of two! It is not just at zero either - the answer is wrong but progressively better for larger x values. Since this integral gives the same wrong answer either numerically or analytically I know it is not a round off problem
This seems to be a common problem with a lot of distributions. Interestingly when I look at algorithms in "Numerical Receipes Art of Programming" for computing the Fourier transform with a DFT or when I look at the considerable literture on the web for evaluating Fourier transforms numerically they never seem to mention this problem and they get lost in the mathematics of fractional FFT's and Kernal functions etc. This seems to be a major problem with any numerical procedure for Fourier transforms and a problem common to a lot of distribution functions which exhibit discontinuities.
How do you handle this?
Last edited: