Univariate 4th-order Gram-Charlier density approximation.
dgc4(x, cmom, rm.neg = TRUE, log = FALSE)
x | Vector of density quantiles. |
---|---|
cmom | Vector of first 4 central moments of distribution. |
rm.neg | Logical; if |
log | Logical; if |
Vector of density evaluations.
df <- 3 nsamples <- 100 X <- rchisq(nsamples, df=df) # iid samples from the Chi-Sq(df) # calculate central moments cmom <- mean(X) cmom <- c(cmom, mean((X-cmom)^2), mean((X-cmom)^3), mean((X-cmom)^4)) curve(dgc4(x, cmom = cmom, rm.neg = TRUE), from = 0, to = 10)