rapx_cf {PDQutils}R Documentation

Approximate random generation via Cornish-Fisher expansion.

Description

Approximate random generation via approximate quantile function.

Usage

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

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

[Package PDQutils version 0.1.6 Index]