Learn R Programming

PDQutils (version 0.1.6)

rapx_cf: 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.

Value

A vector of approximate draws.

Details

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

See Also

qapx_cf

Examples

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

Run the code above in your browser using DataLab