Boost: Noncentral Student \(t\) distribution#

The following functions return the pdf, cdf, qtf or boost class of the non-central Student t distribution with \(n>0\) degrees of freedom, noncentrality parameter \(\delta\), and support interval \((-\infty, +\infty)\).

See also Wikipedia [1257], MathWorld [883], BoostMath [72], Benton and Krishnamoorthy [35], Broda and Paolella [167], Owen [477], Wang and Gray [866], Witkovský [1612], Johansson [406].

Ctx.student_t_nc_pdf(x, n, delta)#

where Ctx is Math53 or CtxBoost.

Returns \(\text{pdf}(x)\), the value of the probability density function (Pdf) of the non-central Student t distribution:

(1)#\[\text{pdf}(x) = f_{\text{StudentT}}\left(n,x, \delta\right) = \int_{0}^{\infty} \phi \left(x \sqrt{\frac{y}{n}} -\delta\right) f_{\chi^2}(y, n) \sqrt{\frac{y}{n}} \: \mathrm{d}y,\]

where \(\phi(\cdot)\) denotes the pdf of the standard normal distribution and \(f_{\chi^2}(\cdot, n)\) denotes the pdf of the \(\chi^2\) distribution with \(n\) degrees of freedom (see chi_squared_pdf()).

Alternatively, the pdf can be written in a form which shows the relationship to the central distribution more clearly:

(2)#\[\text{pdf}(x) = f_{t'}(x; n, \delta) = \frac{n^m \Gamma(n+1) \exp(-\tfrac{1}{2}\delta^2)}{2^n a^m\Gamma(m)} \left[ \frac{\sqrt{2} \delta x \cdot {}_1F_1(m+1;\tfrac{3}{2};y^2)}{a \Gamma(m+\tfrac{1}{2})} - \frac{ {}_1F_1(m+\tfrac{1}{2}; \tfrac{1}{2};y^2)}{\sqrt{a} \Gamma(m+1)} \right],\]
\[m = \frac{n}{2},\quad a = n+x^2, \quad y^2 = \frac{\delta^2x^2}{2a},\]

and \({}_1F_1(\cdot)\) is the confluent hypergeometric function.

The following example shows both forms of the syntax:

>>> from mpfebnet import *
>>> a = 0; b = 1; t = 0.3; x = 0.6;
>>> print ("StudentTNcPdf(x, a, b): ", StudentTNcPdf(x, a, b))
>>> print ("dist_student_t_nc(a, b).pdf(x): ", dist_student_t_nc(a, b).pdf(x))
6.3563523462564525615615615614561356E+00

Ctx.student_t_nc_cdf(x, n, delta)#

where Ctx is Math53 or CtxBoost.

Returns \(\text{cdf}(x)\), the value of the cumulative distribution function (Cdf) of the non-central Student t distribution:

(3)#\[\text{cdf}(x) = F_{\text{StudentT}}\left(x, n, \delta\right) = \int_{0}^{\infty} \Phi \left(x \sqrt{\frac{y}{n}} -\delta\right) f_{\chi^2}(y, n) \: \mathrm{d}y,\]

for \(x<0\) by \(F_{\text{StudentT}}\left(n,x, \delta\right) = 1-F_{\text{StudentT}}\left(n,-x, -\delta\right)\), and for \(x=0\) by \(F_{\text{StudentT}}\left(n,x, \delta\right) = \Phi(-\delta)\).

Here \(\Phi(\cdot)\) denotes the cdf of the standard normal distribution and \(f_{\chi^2}(\cdot, n)\) denotes the pdf of the \(\chi^2\) distribution with \(n\) degrees of freedom.

The following example shows both forms of the syntax:

>>> from mpfebnet import *
>>> a = 0; b = 1; t = 0.3; x = 0.6;
>>> print ("StudentTNcCdf(x, a, b): ", StudentTNcCdf(x, a, b))
>>> print ("dist_student_t_nc(a, b).cdf(x): ", dist_student_t_nc(a, b).cdf(x))
6.3563523462564525615615615614561356E+00

Ctx.student_t_nc_qtf(q, n, delta)#

where Ctx is Math53 or CtxBoost.

Returns \(\text{qtf}(q)\), the value of the quantile function (Qtf) of the non-central Student t distribution:

There is no known closed exact form for \(\text{qtf}(q)\). For fpm. the default method is to call the function provided by Boost.

The following example shows both forms of the syntax:

>>> from mpfebnet import *
>>> a = 0; b = 1; t = 0.3; q = 0.6;
>>> print ("StudentTNcQtf(q, a, b): ", StudentTNcQtf(q, a, b))
>>> print ("dist_student_t_nc(a, b).qtf(q): ", dist_student_t_nc(a, b).qtf(q))
6.3563523462564525615615615614561356E+00

class ctx.dist_student_t_nc(n, lambda1)#

The noncentral \(t\) distribution is a continuous probability distribution with degrees of freedom \(n>0\), noncentrality parameter \(\delta\), and support interval \((-\infty, +\infty)\). See also Wikipedia [1257], MathWorld [883], BoostMath [72], Benton and Krishnamoorthy [35], Broda and Paolella [167], Owen [477], Wang and Gray [866], Witkovský [1612], Johansson [406], R (Statistical System) [544].

See also: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.nctdtr.html#scipy.special.nctdtr

See also: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.nctdtridf.html#scipy.special.nctdtridf

See also: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.nctdtrit.html#scipy.special.nctdtrit

See also: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.nctdtrinc.html#scipy.special.nctdtrinc

Ref: Kim (2007), CI noncentrality parameters

Application: Scholz.

Young, R package tolerance intervals

dist_student_t_nc.pdf(x)#

Returns \(\text{pdf}_X(x)\), the probability density function (pdf) of a random variable \(X\), following a non-central Student t distribution:

\[\text{pdf}_X(x) = f_{t'}(x; n, \delta) = \frac{n^m \Gamma(n+1) \exp(-\tfrac{1}{2}\delta^2)}{2^n a^m\Gamma(m)} \left[ \frac{\sqrt{2} \delta x \cdot {}_1F_1(m+1;\tfrac{3}{2};y^2)}{a \Gamma(m+\tfrac{1}{2})} - \frac{ {}_1F_1(m+\tfrac{1}{2}; \tfrac{1}{2};y^2)}{\sqrt{a} \Gamma(m+1)} \right],\]
\[m = \frac{n}{2},\quad a = n+x^2, \quad y^2 = \frac{\delta^2x^2}{2a},\]

and \({}_1F_1(\cdot)\) is the confluent hypergeometric function.

>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; x = 3;
>>> print ("pdf: ", student_t_nc(mu, sigma).pdf(x))
6.3563523462564525615615615614561356E-20

dist_student_t_nc.cdf(x)#

Returns \(\text{cdf}_X(x)\), the cumulative distribution function (cdf) of a random variable \(X\), following a non-central Student t distribution:

\[\text{cdf}_X(x) = F_{t'}(x; n, \delta) = \int_{0}^{x} f_t(x; n, \delta) \mathrm{d} t = \Phi(-\delta) + \frac{1}{2} \sum_{i=0}^{\infty} P_i I_z\left(i+ \tfrac{1}{2} , m\right) + \frac{\delta}{\sqrt{2}} Q_i I_z\left(i+1, m\right),\]
\[\quad P_i = \frac{e^{-\lambda} \lambda^i}{i!}, \quad Q_i = \frac{e^{-\lambda} \lambda^i}{\Gamma(i+3/2)}; \quad z=\frac{t^2}{n+t^2},\]

and \(I_x(\cdot,\cdot)\) denotes the (normalized) incomplete beta function , and \(\Phi(\cdot)\) denotes the CDF of the normal distribution.

>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; x = 3;
>>> print ("cdf: ", student_t_nc(mu, sigma).pdf(x))
6.3563523462564525615615615614561356E-20

dist_student_t_nc.sf(x)#

Returns \(\text{sf}_X(x)\), the survival function (sf) of a random variable \(X\), following a non-central Student t distribution:

\[\text{sf}_X(x) = 1 - \text{cdf}_X(x) = \int_{x}^{\infty} \text{pdf}_X(x) \mathrm{d} t.\]
>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; x = 3;
>>> print (" sf: ", student_t_nc(mu, sigma).pdf(x))
sf: 6.3563523462564525615615615614561356E-20

dist_student_t_nc.qtf(q)#

Returns \(\text{qtf}_X(x)\), the quantile function (qtf) of a random variable \(X\), following a non-central Student t distribution:

There is no known explicit form for the quantile function \(\text{cdf}^{-1}_X(x)\): It is computed using Newton iterations with starting values from a normal approximation.

>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; q = 0.3;
>>> print ("qtf: ", student_t_nc(mu, sigma).qtf(q))
qtf: 6.3563523462564525615615615614561356E+00

dist_student_t_nc.isf(q)#

Returns \(\text{isf}_X(q)\), the inverse survival function (isf) of a random variable \(X\), following a non-central Student t distribution:

\[\text{isf}_X(q) = \text{qtf}_X(1-q) = \text{cdf}^{-1}_X(1-q).\]
>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; q = 0.3;
>>> print ("isf: ", student_t_nc(mu, sigma).isf(q))
6.3563523462564525615615615614561356E+00

dist_student_t_nc.c_x(t)#

Returns \(C_X(t)\), the characteristic function of a random variable \(X\), following a non-central Student t distribution:

\[C_X(t) = \int_{-\infty}^{\infty} e^{i tx} \text{pdf}_X(x) \mathrm{d} x\]
>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; t = 0.3;
>>> print ("c_x: ", student_t_nc(mu, sigma).c_x(t))
6.3563523462564525615615615614561356E+00

dist_student_t_nc.m_x(t)#

Returns NaN, since the moment generating function does not exist.

dist_student_t_nc.k_x(t, k=0)#

Returns NaN, since the cumulant generating function does not exist.

dist_student_t_nc.moments(k)#

Returns the first \(j\) raw moments, \(\mu_j, j = 1 \ldots k\), of a random variable \(X\), following a non-central Student t distribution. The rth moment only exists for \(n > r\). and is given by

\[\mu'_X(r) = \left({\tfrac{1}{2}n}\right)^{r/2} \frac{\Gamma\left(\tfrac{1}{2}(n-r)\right)}{\Gamma\left(\tfrac{1}{2}n\right)} \times \sum_{i=0}^{\lfloor r/2 \rfloor} { \binom{r}{2i} \frac{(2i)!} {2^i i!}} \delta^{r-2i},\]

See also: Paoella 2, page 381-382

>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; k = 6;
>>> print ("saddlepoint: ", student_t_nc(mu, sigma).moments(k))
6.3563523462564525615615615614561356E+00

dist_student_t_nc.cumulants(k)#

Returns the first \(j\) cumulants, \(\kappa_j, j = 1 \ldots k\), of a random variable \(X\), following a non-central Student t distribution. The cumulants are calculated from the moments.

>>> from mpfunlab import *
>>> mp.dps = 30
>>> mu = 0; sigma = 1; k = 6;
>>> print ("saddlepoint: ", student_t_nc(mu, sigma).cumulants(k))
6.3563523462564525615615615614561356E+00

Approximations

ctx.student_t_nc_ecf(x, n, delta, results='cdf')#

where ctx is ipm, dec, mpm, or gmp.

Calculates the Edgeworth approximation to the pdf, cdf and sf. See also: Paolella [479], page 381-382.

ctx.student_t_nc_ecf_inv(q, n, delta, theta, results='qtf')#

where ctx is ipm, dec, mpm, or gmp.

Calculates the Cornish-Fisher approximation to the qtf and isf.