PDQutils {PDQutils} | R Documentation |
PDQ Functions via Gram Charlier, Edgeworth, and Cornish Fisher Approximations
Description
PDQ Functions via Gram-Charlier, Edgeworth, and Cornish Fisher Approximations
Gram Charlier and Edgeworth Expansions
Given the raw moments of a probability distribution, we can approximate the probability density function, or the cumulative distribution function, via a Gram-Charlier 'A' expansion on the standardized distribution.
Suppose f(x)
is the probability density of some random
variable, and let F(x)
be the cumulative distribution function.
Let He_j(x)
be the j
th probabilist's Hermite
polynomial. These polynomials form an orthogonal basis, with respect to the
function w(x)
of the Hilbert space of functions which are square
w
-weighted integrable. The weighting function is
w(x) = e^{-x^2/2} = \sqrt{2\pi}\phi(x)
.
The orthogonality relationship is
\int_{-\infty}^{\infty} He_i(x) He_j(x) w(x) \mathrm{d}x = \sqrt{2\pi} j! \delta_{ij}.
Expanding the density f(x)
in terms of these polynomials in the
usual way (abusing orthogonality) one has
f(x) \approx \sum_{0\le j} \frac{He_j(x)}{j!} \phi(x) \int_{-\infty}^{\infty} f(z) He_j(z) \mathrm{d}z.
The cumulative distribution function is 'simply' the integral of this expansion. Abusing certain facts regarding the PDF and CDF of the normal distribution and the probabilist's Hermite polynomials, the CDF has the representation
F(x) = \Phi(x) - \sum_{1\le j} \frac{He_{j-1}(x)}{j!} \phi(x) \int_{-\infty}^{\infty} f(z) He_j(z) \mathrm{d}z.
These series contain coefficients defined by the probability distribution under consideration. They take the form
c_j = \frac{1}{j!}\int_{-\infty}^{\infty} f(z) He_j(z) \mathrm{d}z.
Using linearity of the integral, these coefficients are easily computed in terms of the coefficients of the Hermite polynomials and the raw, uncentered moments of the probability distribution under consideration. Note that it may be the case that the computation of these coefficients suffers from bad numerical cancellation for some distributions, and that an alternative formulation may be more numerically robust.
Generalized Gram Charlier Expansions
The Gram Charlier 'A' expansion is most appropriate for random variables
which are vaguely like the normal distribution. For those which are like
another distribution, the same general approach can be pursued. One needs
only define a weighting function, w
, which is the density of the
'parent' probability distribution, then find polynomials,
p_n(x)
which are orthogonal with respect to w
over
its support. One has
f(x) = \sum_{0\le j} p_j(x) w(x) \frac{1}{h_j} \int_{-\infty}^{\infty} f(z) p_j(z) \mathrm{d}z.
Here h_j
is the normalizing constant:
h_j = \int w(z)p_j^2(z)\mathrm{d}z.
One must then use facts about the orthogonal polynomials to approximate the CDF.
Another approach to arrive at the same computation is described by Berberan-Santos.
Cornish Fisher Approximation
The Cornish Fisher approximation is the Legendre inversion of the Edgeworth expansion of a distribution, but ordered in a way that is convenient when used on the mean of a number of independent draws of a random variable.
Suppose x_1, x_2, \ldots, x_n
are n
independent
draws from some probability distribution.
Letting
X = \frac{1}{\sqrt{n}} \sum_{1 \le i \le n} x_i,
the Central Limit Theorem assures us that, assuming finite variance,
X \rightarrow \mathcal{N}(\sqrt{n}\mu, \sigma),
with convergence in n
.
The Cornish Fisher approximation gives a more detailed picture of the
quantiles of X
, one that is arranged in decreasing powers of
\sqrt{n}
. The quantile function is the function q(p)
such that P\left(X \le q(p)\right) = q(p)
. The
Cornish Fisher expansion is
q(p) = \sqrt{n}\mu + \sigma \left(z + \sum_{3 \le j} c_j f_j(z)\right),
where z = \Phi^{-1}(p)
, and c_j
involves
standardized cumulants of the distribution of x_i
of order
j
and higher. Moreover, the c_j
feature decreasing powers
of \sqrt{n}
, giving some justification for truncation.
When n=1
, however, the ordering is somewhat arbitrary.
Legal Mumbo Jumbo
PDQutils is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Note
This package is maintained as a hobby.
Author(s)
Steven E. Pav shabbychef@gmail.com
References
Lee, Y-S., and Lin, T-K. "Algorithm AS269: High Order Cornish Fisher Expansion." Appl. Stat. 41, no. 1 (1992): 233-240. http://www.jstor.org/stable/2347649
Lee, Y-S., and Lin, T-K. "Correction to Algorithm AS269: High Order Cornish Fisher Expansion." Appl. Stat. 42, no. 1 (1993): 268-269. http://www.jstor.org/stable/2347433
AS 269. http://lib.stat.cmu.edu/apstat/269
Jaschke, Stefan R. "The Cornish-Fisher-expansion in the context of Delta-Gamma-normal approximations." No. 2001, 54. Discussion Papers, Interdisciplinary Research Project 373: Quantification and Simulation of Economic Processes, 2001. http://www.jaschke-net.de/papers/CoFi.pdf
S. Blinnikov and R. Moessner. "Expansions for nearly Gaussian distributions." Astronomy and Astrophysics Supplement 130 (1998): 193-205. http://arxiv.org/abs/astro-ph/9711239
M. N. Berberan-Santos. "Expressing a Probability Density Function in Terms of another PDF: A Generalized Gram-Charlier Expansion." Journal of Mathematical Chemistry 42, no 3 (2007): 585-594. http://web.ist.utl.pt/ist12219/data/115.pdf