Characteristic functions of statistical distributions#

Uniform distribution#

The XML code for the example below can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder in the files D01a_CfUniform.3D.xml (D01a-c).

The uniform distribution is a continuous probability distribution on the support interval \([a, b]\) with finite \(a < b\). See also Wikipedia [1195], MathWorld [840], BoostMath [89], Witkovský [1480], R (Statistical System) [537].

Returns \(C_X(t)\), the characteristic function of a random variable \(X\), following a uniform distribution:

\[C_X(t) = \frac{e^{itb} - e^{ita}}{it(b-a)}, \quad \text{for } t\ne 0, 0 \text{ otherwise}.\]

The example below uses the following code in C#

double a = 0.0;
double b = 1.0;
Complex i1 = Complex.ImaginaryOne;
Complex fz = 1.0;
if (t != 0.0)
{
    fz = Complex.Exp(i1 * t * b) - Complex.Exp(i1 * t * a);
    fz /= (i1 * t * (b - a));
}
var y = fz.Real;
var z = -fz.Imaginary;
var x = t;

D01a_CfUniform.3D \(\quad\) D01b_CfUniform.3D \(\quad\) D01c_CfUniform.3D

Left figure: Characteristic function of the uniform distribution, with \(a=0.0\), \(b=1.0\), \(t_0=-20.0\) and \(t_1=20.0\). Perspective camera.

Normal distribution#

The XML code for the example below can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder in the files D02a_Path_Func_CfNormal.3D.xml (D02a-c).

The normal distribution is a continuous probability distribution with mean \(\mu \in \mathbb{R}\), standard deviation \(\sigma > 0\), and the support interval \((-\infty, +\infty)\). See also Wikipedia [1168], MathWorld [835], BoostMath [67], R (Statistical System) [527], Mpmath [544], Mpmath [540].

Returns \(C_X(t)\), the characteristic function of a random variable \(X\), following a normal distribution:

\[C_X(t) = \exp \left( i \mu t - \tfrac{1}{2} \sigma^2 t^2 \right).\]

The example below uses the following code in C#

double mu = 10.0;
double sigma = 1.0;
Complex i1 = Complex.ImaginaryOne;
Complex fz = Complex.Zero;
fz = Complex.Exp(i1 * t * mu - 0.5 * sigma * sigma * t * t);
var y = fz.Real;
var z = -fz.Imaginary;
var x = t;

D02a_Path_Func_CfNormal.3D \(\quad\) D02b_Path_Func_CfNormal.3D \(\quad\) D02c_Path_Func_CfNormal.3D

Left figure: Characteristic function of the normal distribution, with \(\mu=10\), \(\sigma=1\), \(t_0=-2.0\) and \(t_1=2.0\). Perspective camera.

Chi-squared distribution#

The XML code for the example below can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder in the files D03a_Path_Func_CfChiSquared.3D.xml (D03a-c).

The chi-squared distribution is a continuous probability distribution with \(n > 0\) degrees of freedom and the support interval \((0,+\infty)\). See also Wikipedia [1150], MathWorld [798], BoostMath [53], Witkovský [1466], R (Statistical System) [522].

Returns \(C_X(t)\), the characteristic function of a random variable \(X\), following a chi-squared distribution:

\[C_X(t) = (1-2it)^{-n/2}.\]

The example below uses the following code in C#

double nu = 100.0;
Complex i1 = Complex.ImaginaryOne;
Complex fz = Complex.Zero;
fz = Complex.Pow(1 - 2 * i1 * t, -nu / 2);
var x = fz.Real;
var y = -fz.Imaginary;
var z = t;

D03a_Path_Func_CfChiSquared.3D \(\quad\) D03b_Path_Func_CfChiSquared.3D \(\quad\) D03c_Path_Func_CfChiSquared.3D

Left figure: Characteristic function of the chi-squared distribution, with \(n=100\), \(t_0=-0.2\) and \(t_1=0.2\). Perspective camera.

Beta distribution#

The XML code for the example below can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder in the files D04a_Path_Func_CfBeta.3D.xml (D04a-c).

The beta distribution is a continuous probability distribution with parameters \(a > 0\), \(b > 0\), and the support interval \((0, 1)\). See also Wikipedia [1148], MathWorld [797], BoostMath [51], Witkovský [1465], R (Statistical System) [520].

Returns \(C_X(t)\), the characteristic function of a random variable \(X\), following a beta distribution:

\[C_X(t) = {}_1F_1 (a, a+b; it).\]

where \({}_1F_1()\) is Kummer’s confluent hypergeometric function (of the first kind).

The example below uses the following code in C#

double a = 10.0;
double b = 20.0;
Complex i1 = Complex.ImaginaryOne;
var fz = dcplx.zero();
fz = cmath53.hyperg_1f1(a, a + b, i1 * t);
var y = fz.Real;
var z = -fz.Imaginary;
var x = t;

D04a_Path_Func_CfBeta.3D \(\quad\) D04b_Path_Func_CfBeta.3D \(\quad\) D04c_Path_Func_CfBeta.3D

Left figure: Characteristic function of the beta distribution, with \(a=10\), \(b=20\), \(t_0=-40.0\) and \(t_1=40.0\). Perspective camera.

F distribution#

The XML code for the example below can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder in the files D05a_Path_Func_CfFisherF.3D.xml (D05a-c).

The Fisher \(F\)-distribution is a continuous probability distribution with \(m > 0\) and \(n > 0\) degrees of freedom, and the support interval \((0, +\infty)\). See also Wikipedia [1153], MathWorld [801], BoostMath [56], Witkovský [1468], R (Statistical System) [524], Abramowitz and Stegun. [3], Butler and Paolella [166], Chattamvelli and Jones [175], Witkovský [1462].

Returns \(C_X(t)\), the characteristic function of a random variable \(X\), following a central Fisher F distribution:

\[C_X(t) = \int_{0}^{\infty} e^{i tx} \text{pdf}_X(x) \mathrm{d}x = \frac{\Gamma(m/2+n/2)}{\Gamma(n/2)} U \left( \frac{m}{2}, 1-\frac{n}{2}, -\frac{n}{m} it \right)\]

where \(U(\cdot)\) denotes the confluent hypergeometric function of the second kind.

The example below uses the following code in C#

double nu = 21.0;
double mu = 40.0;
double G = ctx.gamma(mu / 2 + nu / 2) / ctx.gamma(nu / 2);
Complex i1 = Complex.ImaginaryOne;
var fz = dcplx.zero();
fz = G * cmath53.hyperg_u(mu / 2, 1 - nu / 2, -(nu / mu) * i1 * t);
var y = fz.Real;
var z = -fz.Imaginary;
var x = t;

D05a_Path_Func_CfFisherF.3D \(\quad\) D05b_Path_Func_CfFisherF.3D \(\quad\) D05c_Path_Func_CfFisherF.3D

Left figure: Characteristic function of the Fisher \(F\)-distribution, with \(m=40\), \(n=20\), \(t_0=-20.0\) and \(t_1=20.0\). Perspective camera.

Non-central Chi-squared distribution#

The XML code for the example below can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder in the files D06a_Path_Func_CfChiSquaredNc.3D.xml (D06a-c).

The noncentral chi-square distribution is a continuous probability distribution with degrees of freedom \(n>0\), noncentrality parameter \(\lambda_1\), and support interval \((0, \infty)\). See also Wikipedia [1166], MathWorld [810], Patnaik [465], Penev and Raykov [467], Wang and Gray [795], Winterbottom [1456], BoostMath [64], Witkovský [1476], Johansson [386], R (Statistical System) [517], Yu [1500].

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

\[C_X(t) = \exp \left(\frac{i \lambda t}{1-2it}\right) (1-2it)^{-n/2}.\]

The example below uses the following code in C#

double nu = 10.0;
double lambda1 = 50.0;
Complex i1 = Complex.ImaginaryOne;
Complex fz = Complex.Zero;
fz = Complex.Pow(1 - 2 * i1 * t, -nu / 2);
fz *= Complex.Exp((i1 * t * lambda1) / (1 - 2 * i1 * t));
var y = fz.Real;
var z = -fz.Imaginary;
var x = t;

D06a_Path_Func_CfChiSquaredNc.3D \(\quad\) D06b_Path_Func_CfChiSquaredNc.3D \(\quad\) D06c_Path_Func_CfChiSquaredNc.3D

Left figure: Characteristic function of the noncentral chi-square distribution, with \(\lambda=50\), \(n=10\), \(t_0=-0.2\) and \(t_1=0.2\). Perspective camera.

Binomial distribution#

The XML code for the example below can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder in the files D07a_Path_Func_CfBinomial.3D.xml (D07a-c).

The binomial distribution is a discrete (lattice) probability distribution with number of trials \(n \ge 0\) and success probability \(0 \le p \le 1\). See also Wikipedia [1175], MathWorld [818], BoostMath [71], Witkovský [1484], R (Statistical System) [531].

Returns \(C_X(t)\), the characteristic function of a random variable \(X\), following an binomial distribution:

\[C_X(t) = \left(P e^{it} + Q\right)^n.\]

The example below uses the following code in C#

double n1 = 20.0;
double p = 0.5;
Complex i1 = Complex.ImaginaryOne;
Complex fz = Complex.Zero;
fz = Complex.Pow(1 - p + p * Complex.Exp(i1 * t), n1);
var x = fz.Real;
var y = -fz.Imaginary;
var z = t;

D07a_Path_Func_CfBinomial.3D \(\quad\) D07b_Path_Func_CfBinomial.3D \(\quad\) D07c_Path_Func_CfBinomial.3D

Left figure: Characteristic function of the binomial distribution, with \(p=0.5\), \(n=20\), \(t_0=-2.0\) and \(t_1=2.0\). Perspective camera.

Hypergeometric distribution#

The XML code for the example below can be found online in the DataXlCalcNet repository or in the corresponding local DataXlCalcNet folder in the files D08a_Path_Func_CfHypergeo.3D.xml (D08a-c).

The hypergeometric distribution is a discrete (lattice) probability distribution with \(k\) successes (random draws for which the object drawn has a specified feature) in \(n \in \{0, 1 ,2, \ldots, N \}\) draws, without replacement, from a finite population of size \(N \in \{0, 1 ,2, \ldots \}`\) that contains exactly \(K \in \{0, 1 ,2, \ldots, N \}\) objects with that feature, wherein each draw is either a success or a failure, and the support interval \((\max(0,n+K-N), \min(K,n))\). See also Wikipedia [1181], MathWorld [826], BoostMath [78], R (Statistical System) [533], Berkopec [31], Johnson et al. [389] page 251.

Returns \(C_X(t)\), the characteristic function of a random variable \(X\), following an hypergeometric distribution:

\[C_X(t) = {}_2F_1(-n, -K; N-K-n+1; e^{it}) \binom{N-K}{n} \bigg/ \binom{N}{n} .\]

where \({}_2F_1(\cdot)\) is the Gauss hypergeometric function.

The example below uses the following code in C#

int N = 50;
int K = 16;
int n1 = 12;
Complex i1 = Complex.ImaginaryOne;
var fz = dcplx.zero();
fz = cmath53.hyperg_2f1(-n1, -K, N - K - n1 + 1, cmath53.exp(i1 * t));
fz = fz * ctx.binomial(N - K, n1) / ctx.binomial(N, n1);
var x = fz.Real;
var y = -fz.Imaginary;
var z = t;

D08a_Path_Func_CfHypergeo.3D \(\quad\) D08b_Path_Func_CfHypergeo.3D \(\quad\) D08c_Path_Func_CfHypergeo.3D

Left figure: Characteristic function of the hypergeometric distribution, with \(N=50\), \(K=16\), \(n=12\), \(t_0=-10.0\) and \(t_1=10.0\). Perspective camera.