Gram-Charlier CDF

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Gram-Charlier CDF

Tolga Uzuner
Hi there,

Does anyone have something better (read faster) than the following for
the CDF of an A-type Gram-Charlier expansion ?

Many thanks in advance,
Tolga



fact <- function (x) gamma(1 + x)

gc <- function(w,skew=0,kurtosis=0)
# gram-charlier density
# to be positive, must respect the constraints:
# [-1.0493,1.0493] and [3,7] respectively
{
sapply(w,function(y)
dnorm(y)-
skew/fact(3)*drv(dnorm,y,3)+
kurtosis/fact(4)*drv(dnorm,y,4))
}

gcd <-function(w,skew=0,kurtosis=0)
# gram-charlier cdf
integrate(function(x) gc(x,skew,kurtosis),-Inf,w)$value

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html