rapx_cf: Approximate random generation via Cornish-Fisher expansion.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/cornish_fisher.r

Description

Approximate random generation via approximate quantile function.

Usage

1
rapx_cf(n, raw.cumulants, support=c(-Inf,Inf))

Arguments

n

number of observations. If 'length(n) > 1', the length is taken to be the number required.

raw.cumulants

an atomic array of the 1st through kth raw cumulants. The first value is the mean of the distribution, the second should be the variance of the distribution, the remainder are raw cumulants.

support

the support of the density function. It is assumed that the density is zero on the complement of this open interval. This defaults to c(-Inf,Inf) for the normal basis, c(0,Inf) for the gamma basis, and c(0,1) for the Beta, and c(-1,1) for the arcsine and wigner.

Details

Given the cumulants of a probability distribution, we approximate the quantile function via a Cornish-Fisher expansion.

Value

A vector of approximate draws.

Author(s)

Steven E. Pav shabbychef@gmail.com

See Also

qapx_cf

Examples

1
2
# normal distribution:
r1 <- rapx_cf(1000, c(0,1,0,0,0,0,0))

PDQutils documentation built on May 2, 2019, 12:39 p.m.