dgc4: Univariate 4th-order Gram-Charlier density approximation.

Description Usage Arguments Value Examples

View source: R/dgc4.R View source: R/old/gausscop-functions.R

Description

Univariate 4th-order Gram-Charlier density approximation.

Usage

1
dgc4(x, cmom, rm.neg = TRUE, log = FALSE)

Arguments

x

Vector of density quantiles.

cmom

Vector of first 4 central moments of distribution.

rm.neg

Logical; if TRUE clips the density at smallest calculated non-negative value.

log

Logical; if TRUE returns approximating density on log scale.

Value

Vector of density evaluations.

Examples

1
2
3
4
5
6
7
8
9
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)

mlysy/GaussCop documentation built on Nov. 6, 2019, 6:19 p.m.