Allgemeine hyperbolische Verteilung#

Die allgemeine hyperbolische Verteilung ist definiert als die Normalvarianz-Mittelwert-Mischung mit der verallgemeinerten inversen Gaußschen Verteilung als Mischverteilung. Die „hyperbolische“ Charakterisierung bezieht sich auf die Tatsache, dass die Form der Log-Wahrscheinlichkeitsverteilung als Hyperbel beschrieben werden kann. Hyperbolische Verteilungen werden manchmal als semi-fat-tailed bezeichnet, da ihre Wahrscheinlichkeitsdichte langsamer abnimmt als „sub-hyperbolische“ Verteilungen (z. B. die Normalverteilung, deren Log-Wahrscheinlichkeit quadratisch abnimmt), aber schneller als andere „Extremwert“-Verteilungen (z. B. die Pareto-Verteilung, deren Log-Wahrscheinlichkeit logarithmisch abnimmt).

Funktionen#

In der Literatur existieren verschiedene Parametrisierungen; SciPy implementiert die „4. Parametrisierung“ nach Prause (1999).

\begin{eqnarray*} f(x, p, a, b) & = & \frac{(a^2 - b^2)^{p/2}} {\sqrt{2\pi}a^{p-0.5} K_p\Big(\sqrt{a^2 - b^2}\Big)} e^{bx} \times \frac{K_{p - 1/2} (a \sqrt{1 + x^2})} {(\sqrt{1 + x^2})^{1/2 - p}} \end{eqnarray*}

für

  • \(x, p \in ( - \infty; \infty)\)

  • \(|b| < a\) wenn \(p \ge 0\)

  • \(|b| \le a\) wenn \(p < 0\)

  • \(K_{p}(.)\) bezeichnet die modifizierte Bessel-Funktion zweiter Art und Ordnung \(p\) (scipy.special.kn)

Die obige Wahrscheinlichkeitsdichte ist in „standardisierter“ Form definiert. Um die Verteilung zu verschieben und/oder zu skalieren, verwenden Sie die Parameter \(\text{loc}\) und \(\text{scale}\). Insbesondere ist \(f(x, p, a, b, \text{loc}, \text{scale})\) identisch gleich \(\frac{1}{\text{scale}}f(y, p, a, b)\) mit \(y = \frac{1}{\text{scale}}(x - \text{loc})\).

Diese Parametrisierung leitet sich von der ursprünglichen \((\lambda, \alpha, \beta, \delta, \mu)\)-Parametrisierung in Barndorff (1978) ab, indem

  • \(\lambda = p\)

  • \(\alpha = \frac{a}{\delta} = \frac{\hat{\alpha}}{\delta}\)

  • \(\beta = \frac{b}{\delta} = \frac{\hat{\beta}}{\delta}\)

  • \(\delta = \text{scale}\)

  • \(\mu = \text{location}\)

gesetzt werden. Zufallsvariablen für scipy.stats.genhyperbolic können effizient aus der oben erwähnten Normalvarianz-Mittelwert-Mischung abgeleitet werden, wobei scipy.stats.geninvgauss parametrisiert ist als \(GIG\Big(p = p, b = \sqrt{\hat{\alpha}^2 - \hat{\beta}^2}, \text{loc} = \text{location}, \text{scale} = \frac{1}{\sqrt{\hat{\alpha}^2 - \hat{\beta}^2}}\Big)\), so dass gilt: \(GH(p, \hat{\alpha}, \hat{\beta}) = \hat{\beta} \cdot GIG + \sqrt{GIG} \cdot N(0,1)\)

Die „allgemeine“ Charakterisierung deutet darauf hin, dass diese Verteilung eine Oberklasse mehrerer anderer Wahrscheinlichkeitsverteilungen ist, zum Beispiel:

  • \(f(p = -\nu/2, a = 0, b = 0, \text{loc} = 0, \text{scale} = \sqrt{\nu})\) hat eine Student’sche t-Verteilung (scipy.stats.t) mit \(\nu\) Freiheitsgraden.

  • \(f(p = 1, a = \hat{\alpha}, b = \hat{\beta}, \text{loc} = \mu, \text{scale} = \delta)\) hat eine hyperbolische Verteilung.

  • \(f(p = - 1/2, a = \hat{\alpha}, b = \hat{\beta}, \text{loc} = \mu, \text{scale} = \delta)\) hat eine Normal-Inverse-Gaußsche-Verteilung (scipy.stats.norminvgauss).

  • \(f(p = 1, a = \delta, b = 0, loc = \mu, \text{scale} = \delta)\) hat eine Laplace-Verteilung (scipy.stats.laplace) für \(\delta \rightarrow 0\)

Beispiele#

Es ist nützlich zu verstehen, wie sich die Parameter auf die Form der Verteilung auswirken. Während es ziemlich einfach ist, die Bedeutung von \(b\) als Schiefe zu interpretieren, ist das Verständnis des Unterschieds zwischen \(a\) und \(p\) nicht so offensichtlich, da beide die Kurtosis der Verteilung beeinflussen. \(a\) kann als Geschwindigkeit des Abfalls der Wahrscheinlichkeitsdichte interpretiert werden (wobei für \(a > 1\) der asymptotische Abfall schneller als \(log_e\) ist und umgekehrt) oder - äquivalent - als Steigung der Asymptote der Log-Wahrscheinlichkeits-Hyperbel (wobei für \(a > 1\) der Abfall schneller als \(|1|\) ist und umgekehrt). \(p\) kann als die Breite der Schultern der Wahrscheinlichkeitsdichteverteilung gesehen werden (wobei \(p < 1\) zu schmalen Schultern führt und umgekehrt) oder - äquivalent - als die Form der Log-Wahrscheinlichkeits-Hyperbel, die für \(p < 1\) konvex und sonst konkav ist.

import numpy as np
from matplotlib import pyplot as plt
from scipy import stats

p, a, b, loc, scale = 1, 1, 0, 0, 1
x = np.linspace(-10, 10, 100)

# plot GH for different values of p
plt.figure(0)
plt.title("Generalized Hyperbolic | -10 < p < 10")
plt.plot(x, stats.genhyperbolic.pdf(x, p, a, b, loc, scale),
        label = 'GH(p=1, a=1, b=0, loc=0, scale=1)')
plt.plot(x, stats.genhyperbolic.pdf(x, p, a, b, loc, scale),
        color = 'red', alpha = 0.5, label='GH(p>1, a=1, b=0, loc=0, scale=1)')
[plt.plot(x, stats.genhyperbolic.pdf(x, p, a, b, loc, scale),
        color = 'red', alpha = 0.1) for p in np.linspace(1, 10, 10)]
plt.plot(x, stats.genhyperbolic.pdf(x, p, a, b, loc, scale),
        color = 'blue', alpha = 0.5, label='GH(p<1, a=1, b=0, loc=0, scale=1)')
[plt.plot(x, stats.genhyperbolic.pdf(x, p, a, b, loc, scale),
        color = 'blue', alpha = 0.1) for p in np.linspace(-10, 1, 10)]
plt.plot(x, stats.norm.pdf(x, loc, scale), label = 'N(loc=0, scale=1)')
plt.plot(x, stats.laplace.pdf(x, loc, scale), label = 'Laplace(loc=0, scale=1)')
plt.plot(x, stats.pareto.pdf(x+1, 1, loc, scale), label = 'Pareto(a=1, loc=0, scale=1)')
plt.ylim(1e-15, 1e2)
plt.yscale('log')
plt.legend(bbox_to_anchor=(1.1, 1))
plt.subplots_adjust(right=0.5)

# plot GH for different values of a
plt.figure(1)
plt.title("Generalized Hyperbolic | 0 < a < 10")
plt.plot(x, stats.genhyperbolic.pdf(x, p, a, b, loc, scale),
        label = 'GH(p=1, a=1, b=0, loc=0, scale=1)')
plt.plot(x, stats.genhyperbolic.pdf(x, p, a, b, loc, scale),
        color = 'blue', alpha = 0.5, label='GH(p=1, a>1, b=0, loc=0, scale=1)')
[plt.plot(x, stats.genhyperbolic.pdf(x, p, a, b, loc, scale),
        color = 'blue', alpha = 0.1) for a in np.linspace(1, 10, 10)]
plt.plot(x, stats.genhyperbolic.pdf(x, p, a, b, loc, scale),
        color = 'red', alpha = 0.5, label='GH(p=1, 0<a<1, b=0, loc=0, scale=1)')
[plt.plot(x, stats.genhyperbolic.pdf(x, p, a, b, loc, scale),
        color = 'red', alpha = 0.1) for a in np.linspace(0, 1, 10)]
plt.plot(x, stats.norm.pdf(x, loc, scale),  label = 'N(loc=0, scale=1)')
plt.plot(x, stats.laplace.pdf(x, loc, scale), label = 'Laplace(loc=0, scale=1)')
plt.plot(x, stats.pareto.pdf(x+1, 1, loc, scale), label = 'Pareto(a=1, loc=0, scale=1)')
plt.ylim(1e-15, 1e2)
plt.yscale('log')
plt.legend(bbox_to_anchor=(1.1, 1))
plt.subplots_adjust(right=0.5)

plt.show()

Referenzen#

Implementierung: scipy.stats.genhyperbolic