See http://en.wikipedia.org/wiki/Pearson_distribution for an introduction to the Pearson distribution, and http://en.wikipedia.org/wiki/Gamma_distribution for an introduction to the Gamma distribution (the Pearson type III distribution is, essentially, a Gamma distribution with 3 parameters).
Definition
Parameters (3): \(\xi\) (location), \(\beta\) (scale), \(\alpha\) (shape).
Moments (3): \(\mu\) (mean), \(\sigma\) (standard deviation), \(\gamma\) (skewness).
If \(\gamma \ne 0\), let \(\alpha=4/\gamma^2\), \(\beta=\frac{1}{2}\sigma |\gamma|\), and \(\xi= \mu - 2 \sigma/\gamma\).
If \(\gamma > 0\), then the range of \(x\) is \(\xi \le x < \infty\) and
$$f(x) = \frac{(x - \xi)^{\alpha - 1} e^{-(x-\xi)/\beta}}{\beta^{\alpha} \Gamma(\alpha)}$$
$$F(x) = G \left(\alpha, \frac{x-\xi}{\beta}\right)/ \Gamma(\alpha)$$
If \(\gamma=0\), then the distribution is Normal, the range of \(x\) is \(-\infty < x < \infty\) and
$$f(x) = \phi \left(\frac{x-\mu}{\sigma}\right)$$
$$F(x) = \Phi \left(\frac{x-\mu}{\sigma}\right)$$
where
\(\phi(x)=(2\pi)^{-1/2}\exp(-x^2/2)\) and
\(\Phi(x)=\int_{-\infty}^x \phi(t)dt\).
If \(\gamma < 0\), then the range of \(x\) is \(-\infty < x \le \xi\) and
$$f(x) = \frac{(\xi - x)^{\alpha - 1} e^{-(\xi-x)/\beta}}{\beta^{\alpha} \Gamma(\alpha)}$$
$$F(x) = G \left(\alpha, \frac{\xi-x}{\beta}\right)/ \Gamma(\alpha)$$
In each case, \(x(F)\) has no explicit analytical form.
Here \(\Gamma\) is the gamma function, defined as $$\Gamma (x) = \int_0^{\infty} t^{x-1} e^{-t} dt$$
and
$$G(\alpha, x) = \int_0^x t^{\alpha-1} e^{-t} dt$$
is the incomplete gamma function.
\(\gamma=2\) is the exponential distribution; \(\gamma=0\) is the Normal distribution; \(\gamma=-2\) is the reverse exponential distribution.
The parameters \(\mu\), \(\sigma\) and \(\gamma\) are the conventional moments of the distribution.
L-moments
Assuming \(\gamma>0\), L-moments are defined for \(0<\alpha<\infty\).
$$\lambda_1 = \xi + \alpha \beta$$
$$\lambda_2 = \pi^{-1/2} \beta \Gamma(\alpha + 1/2)/\Gamma(\alpha)$$
$$\tau_3 = 6 I_{1/3} (\alpha, 2 \alpha)-3$$
where \(I_x(p,q)\) is the incomplete beta function ratio
$$I_x(p,q) = \frac{\Gamma(p+q)}{\Gamma(p)\Gamma(q)} \int_0^x t^{p-1} (1-t)^{q-1} dt$$
There is no simple expression for \(\tau_4\).
Here we use the rational-funcion approximation given by Hosking and Wallis (1997, pp. 201-202).
The corresponding results for \(\gamma <0\) are obtained by changing the signs of \(\lambda_1\), \(\tau_3\) and \(\xi\) wherever they occur above.
Parameters
\(alpha\) is obtained with an approximation.
If \(0<|\tau_3|<1/3\), let \(z=3 \pi \tau_3^2\) and use
$$\alpha \approx \frac{1+0.2906 z}{z + 0.1882 z^2 + 0.0442 z^3}$$
if \(1/3<|\tau_3|<1\), let \(z=1-|\tau_3|\) and use
$$\alpha \approx \frac{0.36067 z - 0.59567 z^2 + 0.25361 z^3}{1-2.78861 z + 2.56096 z^2 -0.77045 z^3}$$
Given \(\alpha\), then
\(\gamma=2 \alpha^{-1/2} sign(\tau_3)\),
\(\sigma=\lambda_2 \pi^{1/2} \alpha^{1/2} \Gamma(\alpha)/\Gamma(\alpha+1/2)\),
\(\mu=\lambda_1\).
Lmom.gamma
and par.gamma
accept input as vectors of equal length.
In f.gamma
, F.gamma
, invF.gamma
and rand.gamma
parameters (mu
, sigma
, gamm
) must be atomic.