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 |
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
Examples
# normal distribution:
r1 <- rapx_cf(1000, c(0,1,0,0,0,0,0))