Skewed Student Distribution¶
Introduction¶
The distribution was proposed in [R1].
The probability density function is given by
\[\begin{split}f\left(x|\eta,\lambda\right)=\begin{cases}
bc\left(1+\frac{1}{\eta-2}\left(\frac{a+bx}{1-\lambda}\right)^{2}\right)
^{-\left(\eta+1\right)/2}, & x<-a/b,\\
bc\left(1+\frac{1}{\eta-2}\left(\frac{a+bx}{1+\lambda}\right)^{2}\right)
^{-\left(\eta+1\right)/2}, & x\geq-a/b,
\end{cases}\end{split}\]
where \(2<\eta<\infty\), and \(-1<\lambda<1\). The constants \(a\), \(b\), and \(c\) are given by
\[a=4\lambda c\frac{\eta-2}{\eta-1},\quad b^{2}=1+3\lambda^{2}-a^{2},
\quad c=\frac{\Gamma\left(\frac{\eta+1}{2}\right)}
{\sqrt{\pi\left(\eta-2\right)}\Gamma\left(\frac{\eta}{2}\right)}.\]
A random variable with this density has mean zero and unit variance. The distribution becomes Student t distribution when \(\lambda=0\).
References¶
[R1] | Hansen, B. E. (1994). Autoregressive conditional density estimation. International Economic Review, 35(3), 705–730. <http://www.ssc.wisc.edu/~bhansen/papers/ier_94.pdf> |
Examples¶
>>> skewt = SkewStudent(eta=3, lam=-.5)
>>> arg = [-.5, 0, .5]
>>> print(skewt.pdf(arg))
[ 0.29791106 0.53007599 0.72613873]
>>> print(skewt.cdf(arg))
[ 0.21056021 0.38664586 0.66350259]
>>> print(skewt.ppf([.1, .5, .9]))
[-0.9786634 0.19359403 0.79257129]
>>> print(skewt.rvs(size=(2, 3)))
[[ 0.02398666 -0.61867166 -1.25345387]
[-0.68277535 -0.30256514 -0.04516005]] #random
Class documentation¶
-
class
skewstudent.skewstudent.
SkewStudent
(eta=10.0, lam=-0.1)[source]¶ Skewed Student distribution class.
Attributes
eta (float) Degrees of freedom. \(2 < \eta < \infty\) lam (float) Skewness. \(-1 < \lambda < 1\) Methods
pdf
(arg)Probability density function (PDF). cdf
(arg)Cumulative density function (CDF). ppf
(arg)Inverse cumulative density function (ICDF). rvs
([size])Random variates with mean zero and unit variance. -
cdf
(arg)[source]¶ Cumulative density function (CDF).
Parameters: arg : array
Grid of point to evaluate CDF at
Returns: array
CDF values. Same shape as the input.
-