bundles / scipy latest / scipy / stats / _morestats / _calc_uniform_order_statistic_medians
function
scipy.stats._morestats:_calc_uniform_order_statistic_medians
source: /scipy/stats/_morestats.py :406
Signature
def _calc_uniform_order_statistic_medians ( n ) Summary
Approximations of uniform order statistic medians.
Parameters
n: intSample size.
Returns
v: 1d float arrayApproximations of the order statistic medians.
Examples
Order statistics of the uniform distribution on the unit interval are marginally distributed according to beta distributions. The expectations of these order statistic are evenly spaced across the interval, but the distributions are skewed in a way that pushes the medians slightly towards the endpoints of the unit interval:import numpy as np n = 4 k = np.arange(1, n+1) from scipy.stats import beta a = k b = n-k+1 beta.mean(a, b)✓
beta.median(a, b)
✗from scipy.stats._morestats import _calc_uniform_order_statistic_medians
✓_calc_uniform_order_statistic_medians(n)
✗import matplotlib.pyplot as plt x = np.linspace(0.0, 1.0, num=50, endpoint=True) pdfs = [beta.pdf(x, a[i], b[i]) for i in range(n)]✓
plt.figure() plt.plot(x, pdfs[0], x, pdfs[1], x, pdfs[2], x, pdfs[3])✗
Aliases
-
scipy.stats._morestats._calc_uniform_order_statistic_medians