Boost: Inverse chisquared distribution#
Returns the pdf, cdf, qtf or boost class of a random variable \(X\), following an inverse chi-squared distribution with shape \(a > 0\), scale \(b > 0\), and the support interval \((0,+\infty)\).
See also Wikipedia [1248], BoostMath [64], Witkovský [1610].
- Ctx.invchisquared_pdf(x, a=0, b=1)#
where
CtxisMath53orCtxBoost.Returns \(\text{pdf}(x)\), the value of the probability density function (Pdf) of the inverse chis-quared distribution:
\[\text{pdf}(x) = \left(\frac{b}{x}\right)^a \frac{e^{-\frac{b}{x}}}{x\Gamma(a)}.\]The following example shows both forms of the syntax:
>>> from mpfebnet import * >>> a = 0; b = 1; t = 0.3; x = 0.6; >>> print ("InvchisquaredPdf(x, a, b): ", InvchisquaredPdf(x, a, b)) >>> print ("dist_invchisquared(a, b).pdf(x): ", dist_invchisquared(a, b).pdf(x)) 6.3563523462564525615615615614561356E+00
- Ctx.invchisquared_cdf(x, a=0, b=1)#
where
CtxisMath53orCtxBoost.Returns \(\text{cdf}(x)\), the value of the cumulative distribution function (Cdf) of the inverse chis-quared distribution:
\[\text{cdf}(x) = Q \left(a, -\frac{b}{x} \right).\]Here \(Q(\cdot)\) denotes the upper regularized incomplete gamma function (RealGammaQ).
The following example shows both forms of the syntax:
>>> from mpfebnet import * >>> a = 0; b = 1; t = 0.3; x = 0.6; >>> print ("InvchisquaredCdf(x, a, b): ", InvchisquaredCdf(x, a, b)) >>> print ("dist_invchisquared(a, b).cdf(x): ", dist_invchisquared(a, b).cdf(x)) 6.3563523462564525615615615614561356E+00
- Ctx.invchisquared_qtf(q, a=0, b=1)#
where
CtxisMath53orCtxBoost.Returns \(\text{qtf}(q)\), the value of the quantile function (Qtf) of the inverse chis-quared distribution:
\[\text{qtf}(q) = \frac{b}{Q^{-1}(a, q)}.\]Here \(Q^{-1}(\cdot)\) denotes the inverse of the upper regularized incomplete gamma function (RealGammaQInv).
The following example shows both forms of the syntax:
>>> from mpfebnet import * >>> a = 0; b = 1; t = 0.3; q = 0.6; >>> print ("InvchisquaredQtf(q, a, b): ", InvchisquaredQtf(q, a, b)) >>> print ("dist_invchisquared(a, b).qtf(q): ", dist_invchisquared(a, b).qtf(q)) 6.3563523462564525615615615614561356E+00
- class ctx.dist_invchisquared(a, b)#
where
ctxisfpm,mpm,ipm,dec,gmporapm.The inverse chisquared distribution is a continuous probability distribution with shape \(a > 0\), scale \(b > 0\), and the support interval \((0,+\infty)\). See also Wikipedia [1272], MathWorld [258], BoostMath [88].
- dist_invchisquared.pdf(x)#
Returns \(\text{pdf}_X(x)\), the probability density function (pdf) of a random variable \(X\), following an inverse chisquared distribution:
\[\text{pdf}_X(x) = \left(\frac{b}{x}\right)^a \frac{e^{-\frac{b}{x}}}{x\Gamma(a)} .\]>>> from mpfunlab import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; x = 3; >>> print ("pdf: ", mp_invchisquared(mu, sigma).pdf(x)) 6.3563523462564525615615615614561356E-20
- dist_invchisquared.cdf(x)#
Returns \(\text{cdf}_X(x)\), the cumulative distribution function (cdf) of a random variable \(X\), following an inverse chisquared distribution:
\[\text{cdf}_X(x) = Q \left(a, -\frac{b}{x} \right).\]where \(Q(\cdot)\) and \(Q^{-1}(\cdot)\) denote the regularized gamma function and its functional inverse.
>>> from mpfunlab import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; x = 3; >>> print ("cdf: ", mp_invchisquared(mu, sigma).pdf(x)) 6.3563523462564525615615615614561356E-20
- dist_invchisquared.sf(x)#
Returns \(\text{sf}_X(x)\), the survival function function (sf) of a random variable \(X\), following an inverse chisquared distribution:
\[\text{sf}_X(x) = P \left(a, -\frac{b}{x} \right).\]>>> from mpfunlab import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; x = 3; >>> print (" sf: ", mp_invchisquared(mu, sigma).pdf(x)) sf: 6.3563523462564525615615615614561356E-20
- dist_invchisquared.qtf(q)#
Returns \(\text{qtf}_X(x)\), the quantile function function (qtf) of a random variable \(X\), following an inverse chisquared distribution:
\[\text{qtf}_X(q) = \frac{b}{Q^{-1}(a, q)}.\]where \(Q(\cdot)\) and \(Q^{-1}(\cdot)\) denote the regularized gamma function and its functional inverse.
>>> from mpfunlab import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; q = 0.3; >>> print ("qtf: ", mp_invchisquared(mu, sigma).qtf(q)) qtf: 6.3563523462564525615615615614561356E+00
- dist_invchisquared.isf(q)#
Returns \(\text{isf}_X(q)\), the inverse survival function function (isf) of a random variable \(X\), following an inverse chisquared distribution:
\[\text{isf}_X(q) = \frac{b}{P^{-1}(a, q)}.\]>>> from mpfunlab import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; q = 0.3; >>> print ("isf: ", mp_invchisquared(mu, sigma).isf(q)) 6.3563523462564525615615615614561356E+00
- dist_invchisquared.c_x(t)#
Returns \(C_X(t)\), the characteristic function of a random variable \(X\), following an inverse chisquared distribution:
\[C_X(t) = \frac{2(-i \beta t)^{\alpha /2}}{\Gamma(\alpha)} K_{\alpha}(\sqrt{-4 i \beta t}),\]where \(K_n(\cdot)\) denotes the modified Bessel function of the second kind.
>>> from mpfunlab import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; t = 0.3; >>> print ("c_x: ", mp_invchisquared(mu, sigma).c_x(t)) 6.3563523462564525615615615614561356E+00
- dist_invchisquared.m_x(t)#
The moment generating function does not exist.
- dist_invchisquared.k_x(t, k=0)#
The cumulant generating function does not exist.
- dist_invchisquared.moments(k)#
Returns the first \(j\) raw moments, \(\mu_j, j = 1 \ldots k\), of a random variable \(X\), following an inverse chisquared distribution. The rth moments only exists for \(\alpha > r\).
\[\mu'_X(r) = \frac{\beta^n}{(\alpha - 1) \cdots (\alpha - n)}\]>>> from mpfunlab import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; k = 6; >>> print ("saddlepoint: ", mp_invchisquared(mu, sigma).moments(k)) 6.3563523462564525615615615614561356E+00
- dist_invchisquared.cumulants(k)#
Returns the first \(j\) cumulants, \(\kappa_j, j = 1 \ldots k\), of a random variable \(X\), following an inverse chisquared distribution. The cumulants are calculated from the moments.
>>> from mpfunlab import * >>> mp.dps = 30 >>> mu = 0; sigma = 1; k = 6; >>> print ("saddlepoint: ", mp_invchisquared(mu, sigma).cumulants(k)) 6.3563523462564525615615615614561356E+00