Library: | VaR |
See also: | VaRcgfDGF2 |
Quantlet: | VaRcharfDG | |
Description: | computes the characteristic function for the class of quadratic forms of Gaussian vectors. |
Usage: | r = VaRcharfDG(t,par) | |
Input: | ||
t | the complex argument to the cgf | |
par | a list defining the distribution; contains at least the following components: theta - the constant term delta - the linear term lambda - the diagonal of the quadratic term | |
Output: | ||
r | the value of the cgf at t |
library("plot") library("VaR") library("math") proc() = VaRcharfDGtest(par,n,xlim) dt =(xlim[2]-xlim[1])/(n-1) t = xlim[1] +(0:(n-1))*dt r = VaRcharfDG(complex(t,t*0),par) z1 = setmask(t~r.re, "line", "blue") z2 = setmask(t~r.im, "line", "red") plot(z1,z2) endp theta = 0 delta = #(0) lambda = #(1.4142) par = list(theta,delta,lambda) VaRcharfDGtest(par,300,#(-40,40))
Plots the real (blue line) and the imaginary part (red line) of the characteristic function for a distribution, which is close to a chi^2 distribution with one degree of freedom.