|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
fft: characteristic function to distributionThe characteristic function is the inverse Fourier transform of the
distribution function. The characteristic function of a normaly distributed random variable is exp(-t^2/2). x=seq(-2,2,length=100) fft(pnorm(x),inverse=T)/length(x) exp(-x^2/2) Why aren't the inverse fft and the mentioned function the same? Thanks for help, Thomas ______________________________________________ R-help@... mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
|
|
Re: fft: characteristic function to distributionOn Wed, 30 Apr 2008, Thomas Steiner wrote:
> The characteristic function is the inverse Fourier transform of the > distribution function. The characteristic function of a normaly > distributed random variable is exp(-t^2/2). The fft is a discrete Fourier transforn, not a continuous one. Further in each case where the normalizing constants are placed and the units of frequecy differ from source to source. ?fft has references to exactly what it computes: please consult them. > > x=seq(-2,2,length=100) > fft(pnorm(x),inverse=T)/length(x) > exp(-x^2/2) > > Why aren't the inverse fft and the mentioned function the same? > Thanks for help, > Thomas > > ______________________________________________ > R-help@... mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Brian D. Ripley, ripley@... Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 ______________________________________________ R-help@... mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
|
|
Re: fft: characteristic function to distributionThank you Prof Ripley for your answer.
> > The characteristic function is the inverse Fourier transform of the > > distribution function. The characteristic function of a normaly > > distributed random variable is exp(-t^2/2). > > > > The fft is a discrete Fourier transforn, not a continuous one. This is correct. I try to approximate the continous normal distribution with infinite support by a set of discrete and bounded points. A real discrete baby example would be the bernoulli distribution: p=0.4 t=seq(-0.01,1.001,length=100) char=1-p+p*exp(1i*t) cdf=stepfun(c(0,1),c(0,1-p,1)) plot(t,cdf(t),type="l",col="red",ylim=range(cdf(t),Re(fft(char)[2:99]))) lines(t,fft(char),col="blue") This is more or less like the normal example. > Further in each case where the normalizing constants are placed and the > units of frequecy differ from source to source. > > ?fft has references to exactly what it computes: please consult them. I read the documentation/help page. More details there would be helpful. For example an example (it says "example*s*") something where explicit expressions are known (as I tried it here). Another possible improvement could be to make for example the following sentence nicer/clearer: "(the inverse has a + in the exponent of e, but here, we do not divide by 1/length(x))." I did not consult the two given references (two old but surely valuable books). Enough prattled. Can you give a working example where the cummulative distribution function and the fourier transform are explicitly known? I cannot add any value neither to wonderful R nor to this helpful function. But perhaps my question isn't that stupid and you can give a hint to proceed. Thank you very much in advance, Thomas ______________________________________________ R-help@... mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
|
|
|
| Free Forum Powered by Nabble | Forum Help |