Re: [R] fft: characteristic function to distribution

From: Thomas Steiner <finbref.2006_at_gmail.com>
Date: Tue, 13 May 2008 11:22:25 +0200

Matthias Kohl was so kind and provided me the following lines in this issue:

library(distrEx)
chf <- function(t, D){
  E(D, function(x){exp(1i*t*x)}, useApply = FALSE) }

## Normalverteilung
D <- Norm()
t <- seq(-3, 3, by = 0.05)

chf.norm <- sapply(t, chf, D = D)
chf.exakt <- exp(-t^2/2)
chf.diff <- chf.norm - chf.exakt

plot(chf.diff)
abs(chf.diff)

This is nice BUT:
* Only built-in distributions can be used

Apart from this it was exactly what i was looking for: I know the characteristic function and want to get the distribution. (My porposal was to use fft(,inverse=T).)
Any help appreciated,
Thomas



R-help_at_r-project.org 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. Received on Tue 13 May 2008 - 09:39:04 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 13 May 2008 - 10:30:36 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive