Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: math
See also: fft invfft

Quantlet: gFourierInversion
Description: is a generic function that approximates the density of a distribution function by numerically inverting its characteristic function.

Usage: r = gFourierInversion(N,K,dt,t0,x0,charf,l)
Input:
N scalar, the modulus of the Fast Fourier Transform (FFT) used; should be a power of 2.
K scalar, the number of evaluations of the characteristic function; K has to be smaller or equal to N; when K < N, the input vector is filled with zeros up to N.
dt scalar, the grid-size in t used for the approximation of the inversion integral
t0 scalar, indicating whether the t-grid includes t = 0 (t0==0) or t = dt/2 (otherwise)
x0 scalar, the starting point of the x-grid
charf string, the name of the characteristic function
l list, containing l.mu (the expectation) and l.sigma (the standard deviation) of the characteristic function (charf).
Output:
r n x 1 vector containing the density values on the x-grid. The grid is given by x_j = x_0 + j dx, dx = 2 pi/(N dt)

Example:
library("math")
library("plot")
mu = 0
sigma = 1
par = list(mu,sigma)
r =gFourierInversion(512,512,0.1,0.05,-pi/0.1,"StandardNormalCharf",par)
di = createdisplay(1,1)
z  = setmask((-pi/0.1+(0:511)*2*pi/(512*0.1)) ~ r, "line")
show(di,1,1,z)
setxaxis(di,1,1,-3,3)

Result:
Approximates the standard normal density and plots it.



Author: S. Jaschke, 20011026 license MD*Tech
(C) MD*TECH Method and Data Technologies, 05.02.2006