Discrete (lattice) distribution functions related to (stratified) rank tests#
Sign test distribution (under \(H_0\)), pmf vector#
- ctx.signtest_pmf_vector(x, n, lambda)#
where
ctxisfpm,mpm,ipm,dec,gmporapm.Returns the vector of all pmf values of the Sign test distribution under \(H_0\). The vector is returned as a nested list of Decimals or as a mp.matrix or as a iv.matrix.
See also Wikipedia [1287], vandeWiel [860], Bennett [34] and Zimmermann [1656], and dist_wilcoxon().
Returns \(\text{pmf}_X(x)\), the probability mass function (pmf) of a random variable \(X\), following a Wilcoxon signed rank T distribution. The null distribution can be calculated as follows: Let \(p_N(w)\) denote the probability \(\text{Pr}[W_N=w]\) in a sample of size \(N\). Then the following recurrence relation holds (see Zimmermann [1656]) :
\[p_N(w) = \tfrac{1}{2} \left( p_{N-1}(w) + p_{N-1}(w-N)\right).\]
Wilcoxon \(T\) distribution (under \(H_0\)), pmf vector#
- ctx.wilcoxon_pmf_vector(x, n, lambda)#
where
ctxisfpm,mpm,ipm,dec,gmporapm.Returns the vector of all pmf values of the Wilcoxon distribution under \(H_0\). The vector is returned as a nested list of Decimals or as a mp.matrix or as a iv.matrix.
See also Wikipedia [1287], Fellingham and Stoker [312], vandeWiel [860], Bennett [34] and Zimmermann [1656], and dist_wilcoxon().
Returns \(\text{pmf}_X(x)\), the probability mass function (pmf) of a random variable \(X\), following a Wilcoxon signed rank T distribution. The null distribution can be calculated as follows: Let \(p_N(w)\) denote the probability \(\text{Pr}[W_N=w]\) in a sample of size \(N\). Then the following recurrence relation holds (see Zimmermann [1656]) :
\[p_N(w) = \tfrac{1}{2} \left( p_{N-1}(w) + p_{N-1}(w-N)\right).\]
Wilcoxon \(T\) distribution (under Bennett alternatives), pmf vector#
- ctx.wilcoxon_bennett_pmf_vector(x, n, lambda)#
where
ctxisfpm,mpm,ipm,dec,gmporapm.Returns the vector of all pmf values of the Wilcoxon \(T\) distribution under Bennett alternatives. The vector is returned as a nested list of Decimals or as a mp.matrix or as a iv.matrix.
See also Wikipedia [1287], Fellingham and Stoker [312], vandeWiel [860], Bennett [34] and Zimmermann [1656], and dist_wilcoxon().
Returns \(\text{pmf}_X(x)\), the probability mass function (pmf) of a random variable \(X\), following a Wilcoxon signed rank T distribution. The null distribution can be calculated as follows: Let \(p_N(w)\) denote the probability \(\text{Pr}[W_N=w]\) in a sample of size \(N\). Then the following recurrence relation holds (see Zimmermann [1656]) :
\[p_N(w) = \tfrac{1}{2} \left( p_{N-1}(w) + p_{N-1}(w-N)\right).\]
Kendall \(S\) (or tau) distribution (under \(H_0\)), pmf vector#
- ctx.kendall_tau_pmf_vector(x, n, lambda)#
where
ctxisfpm,mpm,ipm,dec,gmporapm.Returns the vector of all pmf values of the Kendall \(S\) (or tau) distribution under \(H_0\). The vector is returned as a nested list of Decimals or as a mp.matrix or as a iv.matrix. See also Wikipedia [1274], Noether [447], vandeWiel [860], and dist_kendall().
Returns \(\text{pmf}_X(x)\), the probability mass function (pmf) of a random variable \(X\), following a Kendall tau distribution.
The null distribution can be calculated as follows: Let \(p_N(t) = \text{Pr}[T_N=t]\). Then the following recurrence relation holds:
\[p_N(t) = p_N(t-1) + [p_{N-1}(t) - p_{N-1}(t-N)] /N,\]where \(p_N(t) = 0\) for \(t<0\) or \(t>N(N-1)/2\), and \(p_N(0)=1/N!\).
Mann-Whitney \(U\) distribution (under \(H_0\)), pmf vector#
- ctx.mannwhitney_u_pmf_vector(x, n, lambda)#
where
ctxisfpm,mpm,ipm,dec,gmporapm.Returns the vector of all pmf values of the Mann-Whitney \(U\) distribution under \(H_0\). The vector is returned as a nested list of Decimals or as a mp.matrix or as a iv.matrix.
See also Wikipedia [1277], Murakami and Kamakura [442], Robillard [507], vandeWiel [860] and Zimmermann [1657], and dist_mann_whitney().
Returns \(\text{pmf}_X(x)\), the probability mass function (pmf) of a random variable \(X\), following a Mann-Whitney U distribution. The null distribution of the MW test can be calculated as follows: Let \(p_{n,m}(u)\) denote the probability that \(U=u\) in samples of size \(n\) and \(m\). Then (see Zimmermann [1657])
\[(m+n) p_{n,m}(u) = n p_{n-1,m}(u-m) + m p_{n,m-1}(u) = n p_{n-1,m}(u) + m p_{n,m-1}(u-n)\]
Jonckheere-Terpsta \(S\) distribution (under \(H_0\)), pmf vector#
- ctx.jterpsta_s_pmf_vector(x, n, lambda)#
where
ctxisfpm,mpm,ipm,dec,gmporapm.Returns the vector of all pmf values of the Jonckheere-Terpsta \(S\) distribution under \(H_0\). The vector is returned as a nested list of Decimals or as a mp.matrix or as a iv.matrix.
See also Wikipedia [1273], Murakami and Kamakura [442], Robillard [507], vandeWiel [860], and Skillings [527] and dist_jterpsta().
Returns \(\text{pmf}_X(x)\), the probability mass function (pmf) of a random variable \(X\), following a Jonckheere-Terpsta S distribution. Let \(p(n_1,\ldots,n_k; t) = \text{Pr}[J_N=t]\). If \(J_N\) is based on \(k\) independent samples of sizes \(n_1,\ldots,n_k\), then (Skillings 1980):
\[p(n_1,\ldots,n_k; t) = \sum_{x} p(n_1,\ldots,n_k; x) \times p(n_1,\ldots,n_k; t-x)\]where the sum is over all \(x\) with positive \(p(\cdot)\).
Spearman \(\rho\) distribution (under \(H_0\)), pmf vector#
- ctx.spearman_rho_pmf_vector(x, n, lambda)#
where
ctxisfpm,mpm,ipm,dec,gmporapm.Returns the vector of all pmf values of the Page \(L\) distribution under \(H_0\). The vector is returned as a nested list of Decimals or as a mp.matrix or as a iv.matrix.
See also Wikipedia [1273], vandeWiel [860] and Skillings [527] .
Returns \(\text{pmf}_X(x)\), the probability mass function (pmf) of a random variable \(X\), following a Jonckheere-Terpsta S distribution. Let \(p(n_1,\ldots,n_k; t) = \text{Pr}[J_N=t]\). If \(J_N\) is based on \(k\) independent samples of sizes \(n_1,\ldots,n_k\), then (Skillings 1980):
\[p(n_1,\ldots,n_k; t) = \sum_{x} p(n_1,\ldots,n_k; x) \times p(n_1,\ldots,n_k; t-x)\]where the sum is over all \(x\) with positive \(p(\cdot)\).
Page \(L\) distribution (under \(H_0\)), pmf vector#
- ctx.page_l_pmf_vector(x, n, lambda)#
where
ctxisfpm,mpm,ipm,dec,gmporapm.Returns the vector of all pmf values of the Page \(L\) distribution under \(H_0\). The vector is returned as a nested list of Decimals or as a mp.matrix or as a iv.matrix.
See also Wikipedia [1273], vandeWiel [860], and Skillings [527].
Returns \(\text{pmf}_X(x)\), the probability mass function (pmf) of a random variable \(X\), following a Jonckheere-Terpsta S distribution. Let \(p(n_1,\ldots,n_k; t) = \text{Pr}[J_N=t]\). If \(J_N\) is based on \(k\) independent samples of sizes \(n_1,\ldots,n_k\), then (Skillings 1980):
\[p(n_1,\ldots,n_k; t) = \sum_{x} p(n_1,\ldots,n_k; x) \times p(n_1,\ldots,n_k; t-x)\]where the sum is over all \(x\) with positive \(p(\cdot)\).
Quade \(L\) distribution (under \(H_0\)), pmf vector#
- ctx.quade_l_pmf_vector(x, n, lambda)#
where
ctxisfpm,mpm,ipm,dec,gmporapm.Returns the vector of all pmf values of the Quade \(L\) distribution under \(H_0\). The vector is returned as a nested list of Decimals or as a mp.matrix or as a iv.matrix.
See also Wikipedia [1273], vandeWiel [860], and Skillings [527].
Returns \(\text{pmf}_X(x)\), the probability mass function (pmf) of a random variable \(X\), following a Jonckheere-Terpsta S distribution. Let \(p(n_1,\ldots,n_k; t) = \text{Pr}[J_N=t]\). If \(J_N\) is based on \(k\) independent samples of sizes \(n_1,\ldots,n_k\), then (Skillings 1980):
\[p(n_1,\ldots,n_k; t) = \sum_{x} p(n_1,\ldots,n_k; x) \times p(n_1,\ldots,n_k; t-x)\]where the sum is over all \(x\) with positive \(p(\cdot)\).
Mann-Whitney \(U\) distribution (under Lehmann alternatives), pmf vector#
- ctx.mannwhitney_u_lehmann_pmf_vector(x, n, lambda)#
where
ctxisfpm,mpm,ipm,dec,gmporapm.Lehmann alternatives are of the form \(F_1(x) = :cite:t:`F_0(x)]^k\) or \(F_1(x) = 1-[1-F_0(x)]^k\).
See also: Shorack [523], Shorack [524].
Under Lehmann alternatives, rank order probabilities can be expressed in closed form for \(F_1 = (F_0)^k\): let \(S_1,\ldots,S_n\) denote the ranks of \(Y\) in the combined sample, e.g. \(\text{Pr}[S_1=3,S_2=5)] = P_{3,2}(0,0,1,0,1)\). Then
\[\text{Pr}[S_1=s_1,\ldots,,S_n=s_n) = k^n \frac{n! m!}{\Gamma(n+m+1+n(k-1))} \prod_{j=1}^n \frac{\Gamma(s_j + j(k-1))}{\Gamma(s_j + (j-1)(k-1))}.\]The exact distribution under this alternative can also be calculated using recurrence relations, similar to the null-distribution (Shorack_1966):
Let \(p_{n,m}(u)\) denote the probability that \(U=u\) in samples of size \(n\) and \(m\). Then
\[(km+n) p_{n,m}(u) = n p_{n-1,m}(u-m) + km p_{n,m-1}(u) \quad \text{for } F_1 = (F_0)^k\]\[(km+n) p_{n,m}(u) = n p_{n-1,m}(u) + km p_{n,m-1}(u-n) \quad \text{for } F_1 = 1-(1-F_0)^k\]This recursive procedure allows the calculation of the exact noncentral distribution also for larger samples.
Mann-Whitney \(U\) distribution (under Milton alternatives), pmf vector#
- ctx.mannwhitney_u_milton_pmf_vector(x, n, lambda)#
where
ctxisfpm,mpm,ipm,dec,gmporapm.Returns the vector of all pmf values of the Mann-Whitney \(U\) distribution under Milton alternatives. The vector is returned as a nested list of Decimals or as a mp.matrix or as a iv.matrix.
See also: Milton [437]
We consider \(k\) continuous random variables \(X_i\) with density functions \(f_i\) and sample sizes \(n_i\), \(i=1 \ldots k\), and \(N=n_1+ \ldots +n_k\).
Let \(\textbf{U} = (U_1,\ldots,U_{N}), U_1 < \cdots < U_{N}\), denote the order statistics of the random variables \((X_{1,1},\ldots,X_{1,n_1}, \dots, X_{k,1},\ldots,X_{k,n_k})\), and let \(\textbf{Z} = (Z_1,\ldots,Z_{N})\) denote a random vector of integers \(1,2,\dots,k\), where the \(i^{\text{th}}\) component \(\textbf{Z}_i\) is \(i\) if \(U_i\) is an \(X_i\).
If \(\textbf{z} = (z_1,\ldots,z_{N})\) is a fixed vector of integers \(1,2,\dots,k\) (with each \(i\) occurring \(n_i\) times), the probability of the rank order \(z\), Pr \([\textbf{Z}=\textbf{z}]\), is given by
\[P_{n_1,\ldots,n_k}(\textbf{z} \vert d) = n_1! \ldots n_k! \idotsint\limits_R \prod_{i=1}^{N} f_i(t_i) dt_i,\]where the region of integration \(R\) is \(-\infty < t_1 \leq t_2 \leq \cdots \leq t_{N} < \infty\)
The original algorithm by Milton [437] has been developed for the normal distribution, but it has been found to also work well for the logistic distribution and for Lehmann alternatives, if the reference distribution is normal.